:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.22);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.22), transparent 34rem),
    radial-gradient(circle at 80% 0%, rgba(6, 182, 212, 0.16), transparent 30rem),
    linear-gradient(180deg, #0a0f1d 0%, #060810 100%);
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.bg-orb {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.18;
  pointer-events: none;
}
.bg-orb-a { right: -12rem; top: 10rem; background: var(--accent); }
.bg-orb-b { left: -14rem; bottom: -12rem; background: var(--accent-2); }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #a78bfa;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 860px;
  margin-bottom: 10px;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}
h2 { margin-bottom: 8px; font-size: 20px; letter-spacing: -0.025em; }
.hero-copy { max-width: 620px; color: var(--muted); font-size: 16px; line-height: 1.55; }

.panel, .status-card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.status-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 999px;
}
.status-card strong { display: none; }
.status-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.2; }
.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 0;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}
.status-dot.muted { background: var(--muted-2); box-shadow: 0 0 0 6px rgba(100, 116, 139, 0.12); }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.12); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.58fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border-radius: 28px;
  padding: 24px;
}
.panel-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-head p, .side-panel p { color: var(--muted); line-height: 1.6; }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field span, .toggle strong { font-size: 13px; font-weight: 750; color: #cbd5e1; }
input, select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.56);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
input:focus, select:focus {
  border-color: rgba(129, 140, 248, 0.75);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  background: rgba(2, 6, 23, 0.72);
}

.toggle {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 6px 0 18px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.34);
}
.toggle input { width: 18px; margin-top: 2px; accent-color: var(--accent); }
.toggle small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.45; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.actions.compact { justify-content: flex-end; }
.primary, .ghost {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
}
.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.32);
}
.primary:disabled { opacity: 0.62; cursor: wait; }
.ghost {
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.58);
}


.steps { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 14px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.steps li span { width: 11px; height: 11px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.38); }
.steps li.done { color: #bbf7d0; }
.steps li.done span { border-color: var(--green); background: var(--green); }
.steps li.active { color: #fef3c7; }
.steps li.active span { border-color: var(--amber); background: var(--amber); animation: pulse 1.2s infinite; }
.steps li.error { color: #fecaca; }
.steps li.error span { border-color: var(--red); background: var(--red); }
@keyframes pulse { 50% { transform: scale(1.35); opacity: 0.55; } }

.mini-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-metrics div {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.34);
}
.mini-metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; color: white; }
.mini-metrics span { color: var(--muted); font-size: 12px; }

.result-panel { margin-top: 22px; background: var(--panel-strong); }
.result-head { align-items: center; }
#resultMeta { color: var(--muted); margin-bottom: 0; }
.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  padding: 18px;
  background: rgba(2, 6, 23, 0.35);
}
.report-card h3 { margin: 0 0 10px; font-size: 17px; }
.report-card .markdown { color: #cbd5e1; line-height: 1.74; font-size: 14px; }
.markdown p { margin: 0 0 10px; }
.markdown ul { margin: 8px 0 10px; padding-left: 20px; }
.markdown li { margin: 4px 0; }
.markdown h4 { margin: 14px 0 8px; color: #e0e7ff; font-size: 14px; }
.markdown strong { color: #ffffff; }

.error-box {
  margin-bottom: 16px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 18px;
  padding: 14px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.28);
  white-space: pre-wrap;
}
.raw-report { margin-top: 18px; color: var(--muted); }
.raw-report summary { cursor: pointer; }
pre {
  overflow: auto;
  max-height: 520px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 16px;
  color: #dbeafe;
  background: rgba(2, 6, 23, 0.68);
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .hero, .grid, .section-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(34px, 10vw, 48px); }
  .status-card { justify-self: start; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 24px; }
  .panel { border-radius: 22px; padding: 18px; }
  .field-row, .mini-metrics { grid-template-columns: 1fr; }
  .result-head, .panel-head { display: block; }
  .actions.compact { justify-content: flex-start; margin-top: 14px; }
}
