:root {
  --accent: #087f75;
  --accent-hover: #066b63;
  --accent-soft: #e8f5f3;
  --ink: #182230;
  --text: #344054;
  --muted: #667085;
  --subtle: #98a2b3;
  --canvas: #f5f7f8;
  --surface: #ffffff;
  --surface-muted: #fafbfb;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --shadow: 0 16px 40px rgba(16, 24, 40, .07);
  --font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

.setup-topbar {
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
}

.setup-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(900px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.brand > span:last-child {
  line-height: 1.25;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

.mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.setup-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.setup-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.shell {
  width: min(900px, calc(100% - 48px));
  margin: 44px auto 72px;
}

.setup-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 24px;
}

.eyebrow,
.step-label {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.setup-intro h1,
h1 {
  margin: 0;
  color: var(--ink);
  font-size: 29px;
  line-height: 1.25;
  letter-spacing: 0;
}

.setup-intro p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.install-steps {
  display: grid;
  width: 344px;
  grid-template-columns: repeat(4, 1fr);
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.install-steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1;
}

.install-steps li + li::before {
  position: absolute;
  top: 13px;
  right: 50%;
  width: calc(100% - 27px);
  height: 1px;
  margin-right: 13px;
  background: var(--line-strong);
  content: "";
}

.install-steps li.complete + li::before,
.install-steps li.complete::before {
  background: var(--accent);
}

.install-steps a {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.install-steps span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--canvas);
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.install-steps b {
  font-weight: 600;
}

.install-steps .active,
.install-steps .complete {
  color: var(--accent);
}

.install-steps .active span,
.install-steps .complete span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.install-steps .locked {
  cursor: not-allowed;
}

.workspace {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.install-heading {
  padding: 30px 38px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.install-heading h1 {
  font-size: 20px;
}

.lead {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.step-content,
.step-form {
  padding: 30px 38px 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.database-grid {
  grid-template-columns: 2fr 1fr 2fr;
}

.database-grid label:nth-child(4),
.database-grid label:nth-child(5) {
  grid-column: span 1;
}

.database-grid label:nth-child(5) {
  grid-column: span 2;
}

label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 42px;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:hover {
  border-color: #98a2b3;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 127, 117, .12);
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  padding: 0;
  accent-color: var(--accent);
}

small,
.hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 400;
}

.check input {
  flex: 0 0 auto;
  margin-top: 1px;
}

.check b {
  display: block;
  margin-bottom: 1px;
  color: var(--text);
  font-weight: 600;
}

.hint {
  margin: 20px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 0 5px 5px 0;
  background: var(--accent-soft);
  color: #356b67;
}

.environment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
}

.check-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.check-row div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.check-row b {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-row > strong {
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}

.check-row.failed {
  border-color: #fecdca;
  background: var(--danger-soft);
}

.check-row.failed .check-icon {
  background: #fee4e2;
  color: var(--danger);
}

.check-row.failed > strong {
  color: var(--danger);
}

.environment-summary,
.final-note {
  display: grid;
  gap: 3px;
  margin-top: 20px;
  border-radius: 6px;
  padding: 13px 15px;
}

.environment-summary b,
.final-note b {
  font-size: 12px;
}

.environment-summary span,
.final-note span {
  font-size: 11px;
}

.environment-summary.ready {
  border: 1px solid #abefc6;
  background: var(--success-soft);
  color: var(--success);
}

.environment-summary.blocked {
  border: 1px solid #fecdca;
  background: var(--danger-soft);
  color: var(--danger);
}

.final-note {
  border: 1px solid #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}

.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}

.step-actions p {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 9px 17px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button:focus-visible {
  outline: 3px solid rgba(8, 127, 117, .2);
  outline-offset: 2px;
}

.button span {
  margin-left: 8px;
  font-size: 16px;
  line-height: 1;
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover {
  border-color: #98a2b3;
  background: var(--surface-muted);
}

.alert {
  margin: 22px 38px 0;
  border: 1px solid #fecdca;
  border-radius: 6px;
  padding: 13px 15px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.alert strong {
  display: block;
  font-size: 13px;
}

.alert ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.completion {
  padding: 38px;
}

.success-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid #abefc6;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 26px;
  font-weight: 800;
}

.completion h1 {
  font-size: 24px;
}

.summary {
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
}

.summary div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 600;
}

.summary a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.notice {
  margin: 24px 0;
  border: 1px solid #fedf89;
  border-radius: 6px;
  padding: 13px 15px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
}

code {
  border-radius: 3px;
  padding: 2px 4px;
  background: rgba(181, 71, 8, .08);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .93em;
}

@media (max-width: 760px) {
  .setup-topbar-inner,
  .shell {
    width: min(100% - 28px, 900px);
  }

  .shell {
    margin-top: 32px;
  }

  .setup-intro {
    display: block;
  }

  .install-steps {
    width: min(100%, 380px);
    margin-top: 24px;
  }

  .install-heading,
  .step-content,
  .step-form,
  .completion {
    padding-right: 24px;
    padding-left: 24px;
  }

  .alert {
    margin-right: 24px;
    margin-left: 24px;
  }

  .grid,
  .database-grid,
  .environment-list {
    grid-template-columns: 1fr;
  }

  .database-grid label,
  .database-grid label:nth-child(4),
  .database-grid label:nth-child(5) {
    grid-column: auto;
  }
}

@media (max-width: 440px) {
  .setup-topbar {
    height: 60px;
  }

  .setup-topbar-inner,
  .shell {
    width: calc(100% - 20px);
  }

  .setup-status {
    display: none;
  }

  .shell {
    margin-top: 24px;
  }

  .setup-intro h1 {
    font-size: 25px;
  }

  .install-steps b {
    display: none;
  }

  .install-steps li,
  .install-steps a {
    gap: 0;
  }

  .install-heading,
  .step-content,
  .step-form,
  .completion {
    padding-right: 18px;
    padding-left: 18px;
  }

  .alert {
    margin-right: 18px;
    margin-left: 18px;
  }

  .step-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .step-actions p {
    text-align: center;
  }

  .button {
    width: 100%;
  }

  .summary div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
