.setup-page {
  min-height: 100vh;
  background: radial-gradient(circle at 15% 0%, rgb(99 91 219 / 10%), transparent 34rem), var(--bg);
  color: var(--text);
}

.setup-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.setup-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.setup-brand div { display: grid; gap: 2px; }
.setup-brand strong { font-size: 20px; }

.setup-brand div span,
.setup-footer,
.install-shell small {
  color: var(--muted);
  font-size: 13px;
}

.setup-badge {
  width: fit-content;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
}

.setup-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 32px;
  align-items: end;
  padding: 70px 0 34px;
}

.setup-eyebrow {
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.setup-hero h1,
.install-shell h1 {
  max-width: 720px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.setup-hero > div > p:last-child,
.install-shell > p {
  max-width: 680px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.health-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 82%);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  backdrop-filter: blur(14px);
}

.health-card div { display: grid; gap: 4px; }
.health-card div span { color: var(--muted); font-size: 13px; }

.status-dot,
.install-checks li > span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 5px var(--warning-soft);
}

.health-card.is-ok .status-dot,
.install-checks li.is-ok > span {
  background: var(--success);
  box-shadow: 0 0 0 5px var(--success-soft);
}

.health-card.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px var(--danger-soft);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.setup-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.setup-card h2 { margin-bottom: 8px; font-size: 18px; }
.setup-card > p { margin-bottom: 20px; color: var(--muted); line-height: 1.55; }

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 28px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.config-value {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px;
}

.config-value > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.config-value code {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-value button,
.setup-button {
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 750;
}

.config-value button:focus-visible,
.setup-button:focus-visible { outline: none; box-shadow: var(--focus); }

.scope-list,
.event-list { display: flex; flex-wrap: wrap; gap: 8px; }

.scope-list code,
.event-list code {
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--info);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.setup-card-protected { background: linear-gradient(145deg, var(--surface), var(--brand-soft)); }

.protected-note {
  border-left: 3px solid var(--brand);
  padding: 6px 0 6px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.setup-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 22px; }

.setup-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  padding: 11px 14px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
}

.install-page { display: grid; place-items: center; padding: 20px; }

.install-shell {
  display: grid;
  justify-items: start;
  width: min(560px, 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: clamp(26px, 6vw, 48px);
}

.install-shell .setup-badge { margin: 22px 0 14px; }
.install-shell h1 { font-size: clamp(32px, 7vw, 46px); }

.install-checks {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.install-checks li {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 700;
}

.install-error {
  width: 100%;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 12px;
  font-size: 13px;
}

.setup-button-primary {
  width: 100%;
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  padding: 12px 16px;
  font-size: 14px;
}

.setup-button:disabled { cursor: not-allowed; opacity: .55; }
.install-shell small { justify-self: center; margin-top: 14px; text-align: center; }

@media (max-width: 760px) {
  .setup-hero,
  .setup-grid { grid-template-columns: 1fr; }
  .setup-hero { padding-top: 46px; }
  .setup-brand { align-items: flex-start; }
  .setup-badge { font-size: 10px; }
  .setup-footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .setup-shell { width: min(100% - 24px, 1160px); padding-top: 20px; }
  .setup-badge { display: none; }
  .setup-hero { gap: 24px; padding-top: 40px; }
  .setup-hero h1 { font-size: 38px; }
  .health-card { grid-template-columns: auto 1fr; }
  .health-card .setup-button { grid-column: 1 / -1; width: 100%; }
  .setup-card { padding: 20px; }
  .step-number { margin-bottom: 22px; }
  .config-value { grid-template-columns: minmax(0, 1fr) auto; }
  .install-shell .setup-badge { display: inline-flex; }
}
