:root {
  --bg: #f7f8fc;
  --panel: #ffffff;
  --card: #fdfefe;
  --surface: #eef2fb;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #5b6275;
  --accent: #2b6ef6;
  --accent-2: #4bc7a6;
  --success: #2f9d63;
  --error: #d94855;
  --radius: 16px;
  --shadow: 0 20px 48px rgba(27, 61, 119, 0.12);
  font-family: "Manrope", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background-color: var(--bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text);
}

p {
  margin: 0;
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 18% 24%, rgba(43, 110, 246, 0.18), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(75, 199, 166, 0.18), transparent 32%),
    radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.22), transparent 40%),
    #f7f8fc;
}

.bg .glow {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
}

.bg .glow-a {
  width: 380px;
  height: 380px;
  background: rgba(43, 110, 246, 0.2);
  top: -90px;
  left: 12%;
}

.bg .glow-b {
  width: 420px;
  height: 420px;
  background: rgba(75, 199, 166, 0.24);
  bottom: -120px;
  right: 10%;
}

.bg .grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(43, 110, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.6;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

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

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2b6ef6 0%, #4bc7a6 65%, #7dd6c4 100%);
  border: 1px solid rgba(15, 23, 42, 0.05);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 42px rgba(43, 110, 246, 0.25);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.05));
}

.brand-mark .spark {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.65;
  mix-blend-mode: screen;
}

.brand-mark .spark:first-child {
  top: 10px;
  left: 12px;
}

.brand-mark .spark:last-child {
  bottom: 10px;
  right: 12px;
}

.brand-name {
  margin: 2px 0 0;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(520px, 1.5fr);
  gap: 24px;
  align-items: start;
}

.side-panel {
  background: linear-gradient(180deg, rgba(43, 110, 246, 0.06), rgba(75, 199, 166, 0.08)),
    #ffffff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
}

.side-panel h1 {
  margin: 6px 0 10px;
  line-height: 1.15;
}

.lede {
  margin: 0 0 16px;
  color: var(--muted);
}

.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0 20px;
}

.insight {
  padding: 12px 12px 12px 14px;
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(43, 110, 246, 0.08);
}

.insight h3 {
  margin: 4px 0;
}

.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stepper-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.stepper-item::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 16px;
  bottom: -12px;
  width: 2px;
  background: linear-gradient(180deg, rgba(43, 110, 246, 0.18), transparent);
}

.stepper-item:last-child::before {
  display: none;
}

.stepper-item .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 4px;
  background: rgba(43, 110, 246, 0.14);
  border: 2px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 0 0 6px rgba(43, 110, 246, 0.1);
}

.stepper-title {
  margin: 2px 0;
  font-weight: 700;
}

.stepper-item.is-active {
  border-color: rgba(43, 110, 246, 0.35);
  box-shadow: 0 16px 32px rgba(43, 110, 246, 0.18);
}

.stepper-item.is-active .dot {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 8px rgba(43, 110, 246, 0.16);
}

.stepper-item.is-complete {
  border-color: rgba(75, 199, 166, 0.35);
}

.stepper-item.is-complete .dot {
  background: var(--accent-2);
  border-color: rgba(255, 255, 255, 0.85);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), #ffffff);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) + 2px);
  padding: 20px 18px 16px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.status-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.magic-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.magic-form input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  min-width: 220px;
}

.magic-form input:focus {
  outline: none;
  border-color: rgba(43, 110, 246, 0.8);
  box-shadow: 0 0 0 3px rgba(43, 110, 246, 0.12);
}

.magic-form .pill {
  margin-left: 4px;
}

.step-label {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 8px;
  background: #eef2fa;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 20px;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease-out;
  box-shadow: 0 8px 22px rgba(43, 110, 246, 0.25);
}

.step {
  display: none;
}

.step.visible {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.section-heading h2 {
  margin: 4px 0 6px;
}

.upload-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin: 14px 0 10px;
  border: 1px dashed rgba(43, 110, 246, 0.3);
  border-radius: 16px;
  background: #f6f9ff;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.upload-tile:hover {
  border-color: rgba(43, 110, 246, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(43, 110, 246, 0.12);
}

.upload-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(43, 110, 246, 0.12);
  color: var(--accent);
  border: 1px solid rgba(43, 110, 246, 0.28);
}

.upload-icon svg {
  width: 22px;
  height: 22px;
}

.upload-title {
  margin: 0 0 2px;
  font-weight: 700;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
}

.field span {
  font-weight: 700;
}

textarea,
input[type="number"],
select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: rgba(43, 110, 246, 0.8);
  box-shadow: 0 0 0 3px rgba(43, 110, 246, 0.16);
  background: #fdfefe;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 10px;
  align-items: stretch;
}

.helper-card {
  border: 1px solid var(--border);
  background: #f6f9ff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.review-block {
  padding: 12px;
  border-radius: 12px;
  background: #f9fbff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.review-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-block h3 {
  margin: 0 0 6px;
}

.review-block pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  color: var(--muted);
}

.icon-btn {
  border: 1px solid var(--border-strong);
  background: #ffffff;
  border-radius: 10px;
  padding: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(43, 110, 246, 0.5);
  box-shadow: 0 8px 18px rgba(43, 110, 246, 0.12);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.app-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn.primary {
  background: linear-gradient(120deg, #2b6ef6, #4bc7a6);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(43, 110, 246, 0.22);
}

.btn.primary:hover {
  transform: translateY(-1px);
}

.btn.ghost {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn.success {
  background: linear-gradient(120deg, #2f9d63, #4bc7a6);
  color: #ffffff;
}

.btn.tiny {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.right-buttons {
  display: flex;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(43, 110, 246, 0.05);
}

.pill.ghost {
  background: rgba(15, 23, 42, 0.02);
}

.pill.outline {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

.pill.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(75, 199, 166, 0.18);
}

.pill.live.saving::before {
  animation: pulse 1.2s infinite;
}

.pill.neutral {
  color: var(--text);
  border-color: var(--border);
  background: #ffffff;
}

.pill.success {
  border-color: rgba(47, 157, 99, 0.35);
  color: #1f7c53;
  background: rgba(47, 157, 99, 0.1);
}

.pill.error {
  border-color: rgba(217, 72, 85, 0.45);
  color: #b42334;
  background: rgba(217, 72, 85, 0.08);
}

.info {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
}

.banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed var(--border-strong);
  background: #fdfefe;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0 12px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.banner.visible {
  display: block;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: rgba(15, 23, 42, 0.58);
}

.tiny-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.58);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.75;
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 14px 28px;
  }

  .topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-header,
  .section-heading,
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-group,
  .status-badges,
  .magic-form {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .right-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}
