:root {
  --bg: #f7f6f2;
  --paper: #ffffff;
  --ink: #171717;
  --muted: #6e6a62;
  --line: #dedbd4;
  --soft: #f0eee8;
  --dark: #080908;
  --green: #214d43;
  --mint: #b9e6d8;
  --gold: #c99b4c;
  --shadow: 0 24px 70px rgba(35, 30, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Manrope, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.setup-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 70px);
  border-bottom: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(247, 246, 242, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.top-status {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2da977;
}

.top-status.needs-payment {
  color: #7a5720;
}

.top-status.needs-payment .dot {
  background: var(--gold);
}

.top-status.is-paid .dot {
  background: #2da977;
}

.setup-page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 44px 22px 80px;
}

.setup-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.setup-hero > div,
.plan-card,
.workspace-shell,
.launch-panel {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.setup-hero > div {
  padding: clamp(28px, 5vw, 48px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.92;
}

h2 {
  max-width: 680px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.setup-hero p,
.section-head p,
.actions p,
.plan-card p {
  color: var(--muted);
  line-height: 1.65;
}

.setup-hero p {
  max-width: 680px;
  margin: 22px 0 0;
  font-size: 18px;
}

.plan-card {
  display: grid;
  align-content: space-between;
  min-height: 300px;
  padding: 24px;
  background: var(--dark);
  color: #fff;
}

.plan-card span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-card strong {
  display: block;
  margin-top: 30px;
  font-size: 54px;
}

.plan-card p {
  color: rgba(255, 255, 255, 0.68);
}

.paypal-card {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

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

.payment-row b {
  color: var(--mint);
  font-size: 13px;
  text-transform: uppercase;
}

.paypal-button-shell {
  min-height: 48px;
  overflow: hidden;
}

.payment-load-action {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: #ffc439;
  color: #111;
  cursor: pointer;
  font-weight: 900;
}

.payment-load-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.payment-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) minmax(290px, 360px);
  overflow: hidden;
}

.step-rail {
  display: grid;
  align-content: start;
  background: var(--dark);
  color: #fff;
}

.step-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  min-height: 110px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.step-item span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  font-weight: 900;
}

.step-item strong,
.step-item small {
  display: block;
}

.step-item small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.4;
}

.setup-form-card {
  padding: clamp(22px, 4vw, 34px);
}

.setup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  letter-spacing: 0;
}

input,
select {
  min-height: 50px;
  padding: 0 14px;
}

textarea {
  min-height: 112px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

.wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.actions p {
  margin: 0;
  font-size: 13px;
}

.primary-action,
.launch-item button {
  border: 0;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.primary-action {
  min-height: 52px;
  padding: 0 20px;
}

.primary-action:disabled {
  background: #a6a29a;
  cursor: not-allowed;
}

.preview-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: #f9f8f4;
}

.preview-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.preview-top strong {
  color: var(--green);
}

.agent-preview,
.staff-preview article {
  border: 1px solid var(--line);
  background: var(--paper);
}

.agent-preview {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 16px;
}

.avatar img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.agent-preview span,
.staff-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-preview strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.agent-preview p,
.staff-preview p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.staff-preview article {
  margin-top: 10px;
  padding: 16px;
}

.launch-panel {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 34px);
}

.launch-panel[hidden] {
  display: none;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.launch-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.launch-item span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.launch-item code {
  color: #273631;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.launch-item button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  min-height: 42px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .setup-hero,
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .step-rail {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    overflow-x: auto;
  }

  .preview-card {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .setup-page {
    padding: 28px 14px 56px;
  }

  .top-status {
    display: none;
  }

  .setup-hero > div,
  .plan-card,
  .setup-form-card,
  .preview-card,
  .launch-panel {
    padding: 20px;
  }

  h1 {
    font-size: 44px;
  }

  .setup-form,
  .launch-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action {
    width: 100%;
  }
}
