.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-elevated);
}

@media (max-width: 640px) {
  .card {
    padding: 16px;
  }
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.input,
.select {
  width: 100%;
  min-height: var(--control-height-lg);
  padding: 7px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-input);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  transition: border-color var(--motion), background-color var(--motion), box-shadow var(--motion);
}

.input:hover,
.select:hover {
  border-color: var(--accent-strong);
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

@media (max-width: 640px) {
  .input,
  .select {
    font-size: 16px;
  }
}

.select {
  padding-right: 36px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%, 0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%),
    linear-gradient(to right, var(--surface-input), var(--surface-input));
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.select option {
  background: var(--surface-card);
  color: var(--text-primary);
}

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

.req::after {
  content: '*';
  margin-left: 4px;
  color: var(--danger);
}

.colorDot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}

/* Progress bar */
.progressBar {
  position: relative;
  height: 8px;
  border-radius: 100px;
  background: var(--surface-element);
  overflow: hidden;
  margin-bottom: 24px;
  width: 100%;
}

.progressBar .fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width .3s ease;
}

.progressBar .pct {
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%);
  font-size: .8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.create-flow-page .header-inner {
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .75rem;
  padding-bottom: 1.2rem;
}

.create-flow-page .header-inner > .brand {
  margin-right: auto;
}

.create-flow-page .header-inner > [data-theme-toggle] {
  order: 1;
}

.create-flow-page .header-inner .header-brief {
  flex-basis: 100%;
  margin: 0;
  order: 2;
}

.create-flow-page .header-brief {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
}

.create-flow-page .header-brief span[aria-hidden="true"] {
  font-size: 1.2rem;
  line-height: 1;
}

.create-flow {
  padding: 2.5rem 0 3rem;
}

.create-flow h1 {
  margin-bottom: .5rem;
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.stepper-header {
  margin: 2rem 0 1rem;
}

.stepper-header h2 {
  margin: 0 0 .35rem;
  font-size: 1.35rem;
}

.stepper-header p {
  margin: 0;
  color: var(--text-muted);
  max-width: 42rem;
}

.stepper {
  --stepper-circle: 32px;
  --stepper-gap: clamp(.75rem, 2vw, 1.5rem);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--stepper-gap);
  list-style: none;
  padding: 0 calc(var(--stepper-gap) / 2) 1rem;
  margin: 0 0 2.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.stepper::-webkit-scrollbar {
  height: 6px;
}

.stepper::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.stepper-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  min-width: clamp(140px, 24vw, 220px);
  flex: 1 1 clamp(160px, 25%, 240px);
  padding-bottom: 1rem;
}

.stepper-item::before,
.stepper-item::after {
  content: "";
  position: absolute;
  top: calc(var(--stepper-circle) / 2);
  height: 1px;
  background: var(--border-strong);
  z-index: 0;
  width: max(0px, calc(50% + var(--stepper-gap) / 2 - var(--stepper-circle) / 2));
  transform: translateY(-50%);
}

.stepper-item::before {
  left: calc(var(--stepper-gap) / -2);
}

.stepper-item::after {
  right: calc(var(--stepper-gap) / -2);
}

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

.stepper-icon {
  width: var(--stepper-circle);
  height: var(--stepper-circle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  background: var(--surface-element);
  border: 1px solid transparent;
  color: var(--text-muted);
  position: relative;
  box-shadow: 0 0 0 8px var(--surface);
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
  z-index: 1;
}

.stepper-body {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.stepper-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
}

.stepper-desc {
  font-size: .85rem;
  color: var(--text-muted);
}

.stepper-item.is-active .stepper-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.stepper-item.is-active .stepper-title {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.stepper-item.is-complete::after,
.stepper-item.is-active::before,
.stepper-item.is-complete + .stepper-item::before {
  background: var(--accent);
}

.stepper-item.is-complete .stepper-icon {
  background: var(--accent-bg);
  border-color: var(--accent-bg);
  color: var(--accent-text);
}

.stepper-item.is-complete .stepper-title {
  color: var(--text-primary);
}

.stepper-item.is-upcoming .stepper-desc {
  opacity: .7;
}

.step-panel {
  display: none;
  gap: 1.5rem;
  flex-direction: column;
  animation: step-in .35s ease;
}

.step-panel.is-active {
  display: flex;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-meta {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--surface-element);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  color: var(--text-primary);
}

.step-meta-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.step-meta-step {
  margin: 0;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .85rem;
}

.step-meta-actions {
  margin: .2rem 0 0;
  color: var(--text-muted);
  font-size: .95rem;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.step-footer {
  margin-top: 2.5rem;
  display: flex;
  justify-content: flex-end;
}

.step-footer .btn {
  justify-content: center;
}

.create-flow .card h3 {
  margin-top: 0;
  font-size: var(--font-size-lg);
}

.step-checklist {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.step-checklist li {
  line-height: 1.5;
}

.code-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin: 1rem 0 0;
}

.code-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.code-title {
  font-weight: 600;
  opacity: .85;
}

.code-row .code-badge {
  margin-left: auto;
}

.number-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  text-align: center;
}

.number-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-element);
  border: 1px solid var(--border-strong);
  font-weight: 700;
  letter-spacing: .05em;
}

.number-card .number-chip {
  margin-left: 0;
}

.number-chip-prefix {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .85rem;
  color: var(--text-muted);
}

.number-chip-value {
  font-variant-numeric: tabular-nums;
}

.pairing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pairing-heading {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .02em;
  color: var(--text-primary);
}

.pairing-heading-prefix {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .9rem;
  color: var(--text-muted);
}

.pairing-heading-value {
  font-variant-numeric: tabular-nums;
}

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

  .stepper {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
}

.option-btn {
  min-width: 72px;
}

@media (max-width: 640px) {
  .stepper {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .stepper-item {
    min-width: 140px;
  }

  .step-footer .btn {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .stepper {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .stepper-body {
    text-align: left;
  }

  .stepper {
    padding-bottom: 1rem;
  }
}
