/* Sequence Builder Page */
.page-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 60px 48px 48px;
}
.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.page-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}
.page-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.page-sub {
  font-size: 16px;
  color: var(--fg-muted);
  max-width: 520px;
  line-height: 1.6;
}

/* Builder layout */
.builder-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px;
}
.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Form panel */
.form-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}
.form-section {
  margin-bottom: 32px;
}
.form-section:last-of-type {
  margin-bottom: 24px;
}
.section-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 20px;
  color: var(--fg);
}
.field {
  margin-bottom: 20px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
  color: rgba(138, 138, 150, 0.6);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field-error {
  border-color: #ff4d4d !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.15) !important;
}

/* Type toggle */
.type-toggle {
  display: flex;
  gap: 8px;
}
.type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.type-btn:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--fg);
}
.type-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* Actions */
.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 4px;
}
.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-ghost {
  padding: 13px 20px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--fg);
}

/* Preview panel */
.preview-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: sticky;
  top: 24px;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.preview-header .section-title {
  margin-bottom: 0;
}
.btn-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Empty state */
.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px 24px;
  text-align: center;
}
.preview-empty p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 280px;
}
.preview-empty strong {
  color: var(--fg);
}

/* Preview content */
.preview-content {
  font-size: 15px;
  line-height: 1.7;
}
.preview-content .preview-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.preview-content .preview-subject {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-block;
  margin-bottom: 4px;
}
.preview-content .preview-para {
  margin-bottom: 12px;
  color: var(--fg);
}
.preview-content .preview-para:last-child {
  margin-bottom: 0;
}

/* Mobile */
@media (max-width: 900px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
  .preview-panel {
    position: static;
  }
}
@media (max-width: 768px) {
  .page-header {
    padding: 40px 24px 32px;
  }
  .builder-wrap {
    padding: 24px;
  }
  .nav-back {
    display: none;
  }
}

/* Nav back link */
.nav-back {
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  margin-left: auto;
  transition: color 0.15s;
}
.nav-back:hover {
  color: var(--fg);
}