/* ── Builder Layout ───────────────────────────── */
.builder-main {
  min-height: calc(100vh - 67px);
  padding: 48px;
}

.builder-inner {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

/* ── Form Column ─────────────────────────────── */
.builder-form-col {
  position: sticky;
  top: 88px;
}

.builder-header {
  margin-bottom: 36px;
}

.builder-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 14px;
}

.builder-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 12px;
}

.builder-title em {
  font-style: normal;
  color: var(--amber);
}

.builder-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* ── ICP Form ────────────────────────────────── */
.icp-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-required {
  color: var(--amber);
}

.form-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-input:focus {
  border-color: rgba(255, 154, 60, 0.5);
}

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23f0ede8' stroke-opacity='.55' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── Generate Button ─────────────────────────── */
.btn-generate {
  width: 100%;
  padding: 14px 24px;
  background: var(--amber);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 8px;
}

.btn-generate:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-generate:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Past Campaigns ──────────────────────────── */
.past-section {
  margin-top: 28px;
}

.past-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.past-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.past-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.past-item:hover {
  border-color: rgba(255,154,60,0.3);
}

.past-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.past-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Output Column ───────────────────────────── */
.builder-output-col {
  min-height: 400px;
}

/* Placeholder */
.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  gap: 16px;
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.4;
}

.placeholder-text {
  font-size: 15px;
  color: var(--text-muted);
}

/* Loading */
.output-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.loading-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.loading-dots::after {
  content: '';
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* Error */
.output-error {
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.error-text {
  color: #ff6b6b;
  font-size: 14px;
}

/* ── Result ──────────────────────────────────── */
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.result-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 6px;
}

.result-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-copy-all {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-copy-all:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* ── Sequence Steps ──────────────────────────── */
.sequence-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

.step-card:nth-child(1) { animation-delay: 0.05s; }
.step-card:nth-child(2) { animation-delay: 0.15s; }
.step-card:nth-child(3) { animation-delay: 0.25s; }
.step-card:nth-child(4) { animation-delay: 0.35s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.step-number {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.step-timing {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--amber-dim);
  border: 1px solid rgba(255,154,60,0.2);
  border-radius: 100px;
  padding: 3px 10px;
}

.btn-copy-step {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color 0.15s;
}

.btn-copy-step:hover {
  color: var(--amber);
}

.step-card-body {
  padding: 20px;
}

.step-subject-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 6px;
}

.step-subject {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.4;
}

.step-body-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.step-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-line;
  border-left: 2px solid var(--border);
  padding-left: 14px;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 960px) {
  .builder-main { padding: 24px; }
  .builder-inner { grid-template-columns: 1fr; gap: 32px; }
  .builder-form-col { position: static; }
  .form-row { grid-template-columns: 1fr; }
}
