/* === BRAND SYSTEM === */
:root {
  --white: #FFFFFF;
  --lavender: #7B89FF;
  --violet: #772FF9;
  --indigo: #2B246C;
  --plum: #9B3FE3;
  --accent: var(--violet);
  --accent-soft: rgba(119, 47, 249, 0.12);
  --ink: #05041D;
  --cream: #FBFAF7;
  --paper: #F4F2ED;
  --border: rgba(5, 4, 29, 0.08);
  --border-strong: rgba(5, 4, 29, 0.16);
  --muted: rgba(5, 4, 29, 0.55);
  --muted-2: rgba(5, 4, 29, 0.7);

  --font-sans: 'Helvetica Neue', Helvetica, 'Lato', Arial, sans-serif;
  --font-body: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#root {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* --- Top bar --- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 15px;
}
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet) 0%, var(--lavender) 100%);
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  font-style: italic;
}
.brand-sub { color: var(--muted); font-weight: 400; }

.topbar-right { display: flex; gap: 20px; align-items: center; font-size: 13px; color: var(--muted); }
.progress-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.progress-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(119, 47, 249, 0.15);
}

/* --- Progress bar (top) --- */
.progress-bar {
  position: fixed;
  top: 58px; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  z-index: 9;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.6s var(--ease);
}

/* --- Stage --- */
.stage {
  position: absolute;
  top: 60px; bottom: 70px;
  left: 0; right: 0;
  overflow: hidden;
}

.stage-inner {
  position: absolute;
  inset: 0;
  transition: opacity 260ms cubic-bezier(.2,.7,.2,1), transform 320ms cubic-bezier(.2,.7,.2,1), filter 260ms ease;
  will-change: opacity, transform;
}
.stage-inner.is-entering {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.stage-inner.is-leaving {
  opacity: 0;
  transform: translateY(-14px);
  filter: blur(2px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .stage-inner { transition: opacity 120ms linear; transform: none !important; filter: none !important; }
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 36px 48px 48px;
  overflow-y: auto;
}

.slide-inner {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

/* section label */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
  font-weight: 700;
  margin-bottom: 22px;
}
.section-label .idx {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.q-title {
  font-family: var(--font-sans);
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
  text-wrap: balance;
}
.q-title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--violet);
}
.q-subtitle {
  font-size: 17px;
  color: var(--muted-2);
  margin: 0 0 28px;
  max-width: 620px;
  text-wrap: pretty;
}

/* === CARDS === */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.cards-grid.single { grid-template-columns: 1fr; }

.card {
  position: relative;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  width: 100%;
}
.card:hover {
  border-color: var(--violet);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -12px rgba(119, 47, 249, 0.25);
}
.card.selected {
  border-color: var(--violet);
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F2FF 100%);
  box-shadow: 0 0 0 3px rgba(119, 47, 249, 0.15);
}
.card-label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-label .tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  padding: 3px 8px;
  border-radius: 999px;
}
.card-body {
  font-size: 14.5px;
  color: var(--muted-2);
  line-height: 1.5;
}
.card-check {
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: white;
  display: grid; place-items: center;
  transition: all 0.2s var(--ease);
}
.card.selected .card-check {
  background: var(--violet);
  border-color: var(--violet);
}
.card.selected .card-check svg { opacity: 1; }
.card-check svg { opacity: 0; transition: opacity 0.15s; }

/* Card variant: A/B comparison */
.ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.ab-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex; flex-direction: column;
  min-height: 220px;
}
.ab-card:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}
.ab-card.selected {
  border-color: var(--violet);
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F2FF 100%);
  box-shadow: 0 0 0 3px rgba(119, 47, 249, 0.15);
}
.ab-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 10px;
}
.ab-sample {
  background: var(--paper);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  flex: 1;
  white-space: pre-wrap;
}
.ab-sample.bubble {
  border-bottom-left-radius: 2px;
  position: relative;
}
.ab-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* === CHIPS === */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.chip:hover { border-color: var(--violet); color: var(--violet); }
.chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.chip-add {
  color: var(--muted);
  border-style: dashed;
}

/* === TEXT INPUT === */
.textfield {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 26px;
  line-height: 1.35;
  padding: 14px 0;
  color: var(--ink);
  outline: none;
  border-bottom: 2px solid var(--border-strong);
  transition: border-color 0.2s;
  letter-spacing: -0.015em;
}
.textfield:focus { border-color: var(--violet); }
.textfield::placeholder { color: rgba(5, 4, 29, 0.28); }

.textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  background: white;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  padding: 16px 18px;
  color: var(--ink);
  outline: none;
  resize: vertical;
  min-height: 110px;
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}
.textarea:focus { border-color: var(--violet); }

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.input-group input, .input-group select {
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.input-group input:focus, .input-group select:focus { border-color: var(--violet); }

/* fallback freeform */
.freeform-toggle {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}
.freeform-toggle:hover { color: var(--violet); text-decoration-color: var(--violet); }

/* AI regenerate button */
.ai-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-2);
  cursor: pointer;
  transition: all 0.15s;
}
.ai-refresh:hover { border-color: var(--violet); color: var(--violet); }
.ai-refresh.loading { pointer-events: none; opacity: 0.6; }
.ai-refresh .spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  color: var(--violet);
  margin-bottom: 6px;
}
.ai-badge .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 3px rgba(119, 47, 249, 0.2);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(119, 47, 249, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(119, 47, 249, 0.05); }
}

.skeleton {
  background: linear-gradient(90deg, var(--paper) 25%, #EAE6DC 50%, var(--paper) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Footer --- */
.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 70px;
  background: var(--cream);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 10;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
  background: none;
  color: var(--ink);
}
.btn-primary {
  background: var(--ink);
  color: white;
}
.btn-primary:hover {
  background: var(--violet);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  color: var(--muted-2);
}
.btn-ghost:hover { color: var(--ink); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.kbd-hint {
  font-size: 12px;
  color: var(--muted);
  display: flex; gap: 8px; align-items: center;
}
.kbd {
  font-family: var(--font-sans);
  background: white;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
}

/* --- Transitions --- */
.slide-enter { opacity: 0; transform: translateY(24px); }
.slide-active { opacity: 1; transform: translateY(0); transition: opacity 0.45s var(--ease), transform 0.5s var(--ease); }
.slide-exit { opacity: 0; transform: translateY(-24px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }

.transition-fade .slide-enter { transform: none; }
.transition-fade .slide-exit { transform: none; }
.transition-slide-x .slide-enter { transform: translateX(40px); }
.transition-slide-x .slide-exit { transform: translateX(-40px); }

/* --- Intro screen --- */
.intro {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.intro-inner {
  max-width: 640px;
  text-align: left;
}
.intro-eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--violet);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.intro-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--violet);
}
.intro h1 {
  font-family: var(--font-sans);
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 18px;
}
.intro h1 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--violet);
}
.intro p {
  font-size: 18px;
  color: var(--muted-2);
  margin: 0 0 32px;
  max-width: 520px;
}
.intro-meta {
  display: flex; gap: 32px;
  margin-bottom: 36px;
  font-size: 13.5px;
  color: var(--muted);
}
.intro-meta div { display: flex; flex-direction: column; gap: 2px; }
.intro-meta .meta-val {
  font-family: var(--font-sans);
  color: var(--ink);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}

/* --- Summary --- */
.summary {
  padding: 40px 48px 80px;
  max-width: 920px;
  margin: 0 auto;
}
.summary h2 {
  font-family: var(--font-sans);
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 12px;
}
.summary h2 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--violet);
}
.summary-lead {
  color: var(--muted-2);
  font-size: 17px;
  margin: 0 0 36px;
}
.summary-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.summary-section:hover { border-color: var(--border-strong); }
.summary-section-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  margin-bottom: 8px;
}
.summary-section-head h3 {
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0;
  color: var(--muted);
}
.summary-edit {
  background: none; border: none; color: var(--violet);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  cursor: pointer; padding: 0;
}
.summary-edit:hover { text-decoration: underline; }
.summary-value {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.summary-value.editable {
  outline: 2px solid var(--violet);
  outline-offset: 4px;
  border-radius: 6px;
}
.summary-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 15px;
}
.summary-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px;
}
.summary-tag {
  background: var(--paper);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.summary-cta {
  margin-top: 36px;
  padding: 28px;
  background: var(--ink);
  color: white;
  border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.summary-cta h4 {
  font-family: var(--font-sans);
  font-size: 22px; letter-spacing: -0.015em; font-weight: 700;
  margin: 0 0 6px;
}
.summary-cta h4 em {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  color: var(--lavender);
}
.summary-cta p { margin: 0; color: rgba(255,255,255,0.65); font-size: 14.5px; max-width: 440px; }
.btn-send {
  background: var(--lavender);
  color: var(--ink);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
}
.btn-send:hover { background: white; }

/* --- Tweaks panel --- */
.tweaks-panel {
  position: fixed;
  bottom: 84px; right: 18px;
  width: 280px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px;
  z-index: 30;
  box-shadow: 0 20px 40px -20px rgba(5, 4, 29, 0.25);
  font-family: var(--font-sans);
}
.tweaks-panel h5 {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-panel h5 span { color: var(--violet); font-size: 10px; }
.tweak-group { margin-bottom: 14px; }
.tweak-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tweak-opts { display: flex; gap: 4px; flex-wrap: wrap; }
.tweak-opt {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: center;
  color: var(--muted-2);
  transition: all 0.15s;
}
.tweak-opt:hover { border-color: var(--violet); color: var(--violet); }
.tweak-opt.active { background: var(--ink); color: white; border-color: var(--ink); }

/* card styles from tweaks */
body[data-cards="flat"] .card,
body[data-cards="flat"] .ab-card {
  border-width: 1px;
  box-shadow: none !important;
  background: var(--paper);
}
body[data-cards="flat"] .card:hover, body[data-cards="flat"] .ab-card:hover { background: #EEEAE0; transform: none; }
body[data-cards="flat"] .card.selected, body[data-cards="flat"] .ab-card.selected {
  background: white;
  border-color: var(--ink);
  box-shadow: none !important;
}

body[data-cards="bordered"] .card,
body[data-cards="bordered"] .ab-card {
  border-width: 2px;
  box-shadow: none;
}
body[data-cards="bordered"] .card:hover, body[data-cards="bordered"] .ab-card:hover {
  box-shadow: none;
  border-color: var(--ink);
  transform: none;
}

body[data-cards="glass"] {
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(123, 137, 255, 0.22), transparent),
    radial-gradient(1000px 500px at 120% 100%, rgba(119, 47, 249, 0.18), transparent),
    var(--cream);
}
body[data-cards="glass"] .card,
body[data-cards="glass"] .ab-card {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 10px 30px -20px rgba(5, 4, 29, 0.2);
}
body[data-cards="glass"] .card.selected,
body[data-cards="glass"] .ab-card.selected {
  background: rgba(255,255,255,0.95);
  border-color: var(--violet);
}

/* --- Voice dictate button --- */
.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(20,15,35,0.04);
}
.voice-btn:hover:not(:disabled) {
  border-color: var(--violet);
  color: var(--violet);
}
.voice-btn:disabled { cursor: default; opacity: 0.7; }
.voice-btn[data-status="recording"] {
  border-color: #E53E3E;
  color: #E53E3E;
  background: #FFF5F5;
}
.voice-btn[data-status="transcribing"] {
  border-color: var(--violet);
  color: var(--violet);
  background: #F6F2FF;
}
.voice-btn[data-status="error"] {
  border-color: #E53E3E;
  color: #E53E3E;
}
.voice-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}
.voice-btn[data-status="recording"] .voice-dot {
  background: #E53E3E;
  animation: voice-pulse 1s ease-in-out infinite;
}
.voice-btn[data-status="idle"] .voice-dot,
.voice-btn[data-status="transcribing"] .voice-dot {
  display: none;
}
@keyframes voice-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.voice-textarea-wrap .textarea {
  padding-bottom: 48px !important; /* room for voice button */
}
body[data-transition="fade"] .slide-enter { transform: none; }
body[data-transition="fade"] .slide-exit { transform: none; }
body[data-transition="slide"] .slide-enter { transform: translateX(40px); opacity: 0; }
body[data-transition="slide"] .slide-exit { transform: translateX(-40px); opacity: 0; }
body[data-transition="scale"] .slide-enter { transform: scale(0.96); opacity: 0; }
body[data-transition="scale"] .slide-exit { transform: scale(1.04); opacity: 0; }

body[data-tone="juguetón"] .q-title em,
body[data-tone="juguetón"] .intro h1 em,
body[data-tone="juguetón"] .summary h2 em {
  transform: rotate(-2deg);
  display: inline-block;
}
body[data-tone="juguetón"] .brand-mark {
  animation: wiggle 3s ease-in-out infinite;
}
body[data-tone="juguetón"] .section-label .idx {
  border-radius: 50%;
}
body[data-tone="juguetón"] .btn-primary:hover {
  transform: translateY(-2px) rotate(-1deg);
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}
body[data-tone="serio"] .q-title em,
body[data-tone="serio"] .intro h1 em,
body[data-tone="serio"] .summary h2 em {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
}

/* scroll */
.slide::-webkit-scrollbar { width: 8px; }
.slide::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.preview-hint {
  margin-top: 18px;
  padding: 12px 16px;
  background: rgba(123, 137, 255, 0.08);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--indigo);
  display: flex; gap: 10px; align-items: flex-start;
}
.preview-hint strong { font-weight: 700; }

/* inline faq builder */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.faq-item {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.faq-item:hover { border-color: var(--border-strong); }
.faq-item.selected { border-color: var(--violet); background: #FAF7FF; }
.faq-q {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
}
.faq-a {
  font-size: 14.5px;
  color: var(--muted-2);
  line-height: 1.5;
}
.faq-item-controls {
  display: flex; gap: 8px;
  margin-top: 4px;
  opacity: 0.6;
}
.faq-item:hover .faq-item-controls { opacity: 1; }
.faq-control-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.faq-control-btn:hover { color: var(--violet); }

.inline-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.inline-add input {
  flex: 1;
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  border-radius: 10px;
  outline: none;
}
.inline-add input:focus { border-style: solid; border-color: var(--violet); background: white; }

/* avatar preview for agent identity */
.agent-preview {
  margin-top: 18px;
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.agent-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--lavender));
  display: grid; place-items: center;
  color: white; font-weight: 700; font-family: var(--font-sans);
  flex-shrink: 0;
}
.agent-bubble {
  background: var(--paper);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  flex: 1;
}

/* Signature corner mark */
.corner-mark {
  position: fixed;
  bottom: 80px; left: 18px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  color: var(--muted);
  z-index: 5;
  opacity: 0.6;
}

@media (max-width: 720px) {
  .cards-grid, .ab-grid, .input-row { grid-template-columns: 1fr; }
  .q-title { font-size: 28px; }
  .intro h1 { font-size: 40px; }
  .summary { padding: 24px 20px 80px; }
  .tweaks-panel { width: calc(100% - 36px); }
}

/* === Acento por sección === */
body { transition: background-color 0.4s var(--ease); }
body[data-section="1"] { --accent: var(--violet);   --accent-soft: rgba(119, 47, 249, 0.12); }
body[data-section="2"] { --accent: var(--lavender); --accent-soft: rgba(123, 137, 255, 0.14); }
body[data-section="3"] { --accent: var(--indigo);   --accent-soft: rgba(43, 36, 108, 0.12); }
body[data-section="4"] { --accent: var(--plum);     --accent-soft: rgba(155, 63, 227, 0.12); }
body[data-section="5"] { --accent: var(--violet);   --accent-soft: rgba(119, 47, 249, 0.12); }
body[data-section="6"] { --accent: var(--lavender); --accent-soft: rgba(123, 137, 255, 0.14); }
body[data-section="7"] { --accent: var(--indigo);   --accent-soft: rgba(43, 36, 108, 0.12); }
body[data-section="8"] { --accent: var(--plum);     --accent-soft: rgba(155, 63, 227, 0.12); }
body[data-section="9"] { --accent: var(--lavender); --accent-soft: rgba(123, 137, 255, 0.14); }
body[data-section="10"] { --accent: var(--violet);  --accent-soft: rgba(119, 47, 249, 0.12); }

body[data-agent-type="agendador"]     { --accent: var(--violet);   --accent-soft: rgba(119, 47, 249, 0.12); }
body[data-agent-type="cotizador"]     { --accent: #2D8A5F;         --accent-soft: rgba(45, 138, 95, 0.12); }
body[data-agent-type="recepcionista"] { --accent: #C4632C;         --accent-soft: rgba(196, 99, 44, 0.12); }

/* === Intersticial === */
.interstitial {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  animation: fadeInUp 0.5s var(--ease) both;
}
.interstitial-inner {
  max-width: 620px;
  text-align: center;
}
.interstitial-eyebrow {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}
.interstitial-title {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 18px 0;
  color: var(--ink);
}
.interstitial-title em {
  color: var(--accent);
  font-style: italic;
}
.interstitial-desc {
  color: var(--muted-2);
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Agent Types Multi === */
.agent-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.agent-type-card {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  color: var(--ink);
}
.agent-type-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.agent-type-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 30px -10px var(--accent-soft);
}
.agent-type-check {
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}
.agent-type-card.is-selected .agent-type-check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.agent-type-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.agent-type-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.agent-type-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
}
.agent-type-desc {
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0 14px;
  min-height: 42px;
}

/* Flow nodes */
.agent-flow {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-node {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.25s;
}
.agent-type-card.is-selected .flow-node {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}
.flow-num {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  min-width: 16px;
}
.flow-label {
  font-size: 13px;
  color: var(--ink);
}
.flow-arrow {
  display: flex;
  justify-content: center;
  height: 14px;
  position: relative;
  color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.flow-dot {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  box-shadow: 0 0 8px var(--accent);
  animation: flowPulse 2.4s ease-in-out infinite;
}
@keyframes flowPulse {
  0%   { opacity: 0; top: -2px; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; top: 12px; }
}

@media (max-width: 900px) {
  .agent-types-grid { grid-template-columns: 1fr; }
  .agent-type-desc { min-height: 0; }
}

/* SteppedSlider reutiliza la clase .linear-slider para consistencia visual. */

/* === Linear Slider === */
.linear-slider { padding: 32px 16px; text-align: center; }
.linear-slider-value {
  font-family: var(--font-display);
  color: var(--accent);
  margin-bottom: 28px;
}
.value-big { font-size: 64px; line-height: 1; font-weight: 400; }
.value-unit { font-size: 22px; margin-left: 6px; color: var(--muted-2); }
.linear-slider input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 0%), var(--border) var(--pct, 0%), var(--border) 100%);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}
.linear-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--accent);
  cursor: grab;
  box-shadow: 0 2px 8px var(--accent-soft);
}
.linear-slider input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--accent);
  cursor: grab;
}
.linear-slider-bounds {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

/* === Info Card === */
.info-card {
  display: flex;
  gap: 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 24px;
  color: var(--ink);
}
.info-card-icon {
  color: var(--accent);
  flex-shrink: 0;
}
.info-card-body h4 {
  margin: 0 0 4px 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--accent);
}
.info-card-body p {
  margin: 0;
  color: var(--muted-2);
  line-height: 1.5;
}

/* === Weekly Availability Grid === */
.avail-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--cream);
  user-select: none;
  margin-top: 12px;
}
.avail-header-row {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.avail-time-header, .avail-day-header {
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted-2);
}
.avail-body {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  position: relative;
  height: 420px;
}
.avail-time-col {
  display: grid;
  grid-template-rows: repeat(14, 1fr);
  border-right: 1px solid var(--border);
  background: var(--paper);
}
.avail-time-label {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  padding: 2px 6px 0 0;
  border-top: 1px solid var(--border);
}
.avail-time-label:first-child { border-top: none; }
.avail-day-col {
  position: relative;
  display: grid;
  grid-template-rows: repeat(14, 1fr);
  border-right: 1px solid var(--border);
}
.avail-day-col:last-child { border-right: none; }
.avail-cell {
  border-top: 1px solid var(--border);
  cursor: crosshair;
  transition: background 0.1s;
}
.avail-cell:first-child { border-top: none; }
.avail-cell:hover { background: var(--accent-soft); }
.avail-block {
  position: absolute;
  left: 3px; right: 3px;
  background: color-mix(in srgb, var(--avail-accent) 20%, var(--cream));
  border: 1px solid var(--avail-accent);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 10px;
  color: var(--ink);
  transition: all 0.15s;
}
.avail-block:hover { background: color-mix(in srgb, var(--avail-accent) 30%, var(--cream)); }
.avail-block.is-preview {
  opacity: 0.5;
  border-style: dashed;
  pointer-events: none;
}
.avail-block-range { font-weight: 600; }
.avail-block-dur { opacity: 0.6; font-size: 9px; }
.avail-hint {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--border);
  margin: 0;
  font-style: italic;
}

/* === Callers List === */
.callers-list { margin-top: 16px; }
.callers-empty {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-style: italic;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.caller-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}
.caller-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.caller-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}
.caller-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.caller-fields input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--cream);
  color: var(--ink);
}
.caller-fields input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.caller-remove {
  background: transparent;
  border: 1px solid var(--border);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.caller-remove:hover { border-color: #c57878; color: #c57878; }
.caller-cal-label {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 6px;
}
.caller-add {
  width: 100%;
  padding: 14px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--muted-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}
.caller-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Drag Order Questions === */
.drag-order { margin-top: 12px; }
.drag-order-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.drag-order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.drag-order-item.is-dragging { opacity: 0.4; }
.drag-order-item.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drag-order-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: -2px;
}
.drag-order-num {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drag-order-item input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 4px 0;
  outline: none;
}
.drag-order-del {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
}
.drag-order-del:hover { color: #c57878; }
.drag-order-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.drag-order-add input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}
.drag-order-add button {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
}
.drag-order-add button:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.drag-order-suggestions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.drag-order-suggestions-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
.suggestion-chip {
  padding: 6px 12px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 100px;
  color: var(--muted-2);
  font-size: 12px;
  cursor: pointer;
}
.suggestion-chip:hover { border-color: var(--accent); color: var(--accent); border-style: solid; background: var(--accent-soft); }
.drag-order-loading { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 6px; }

/* === Team Member Field === */
.team-member-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.team-member-field .input-group { display: flex; flex-direction: column; gap: 4px; }
.team-member-field label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.team-member-field input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--cream);
  color: var(--ink);
}
.team-member-field input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

/* === Routing List === */
.routing-list { margin-top: 12px; }
.routing-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.routing-intent, .routing-dest { display: flex; flex-direction: column; gap: 4px; }
.routing-item label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.routing-item input, .routing-item select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--cream);
  color: var(--ink);
}
.routing-arrow {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  padding-bottom: 9px;
}
.routing-del {
  background: transparent;
  border: 1px solid var(--border);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  align-self: end;
}
.routing-del:hover { border-color: #c57878; color: #c57878; }
.routing-add {
  width: 100%;
  padding: 12px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--muted-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  font: inherit;
  margin-top: 8px;
}
.routing-add:hover { border-color: var(--accent); color: var(--accent); }
.routing-suggestions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.routing-suggestions-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === Celebration === */
.celebration {
  max-width: 880px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  animation: fadeInUp 0.6s var(--ease) both;
}
.celebration-hero { text-align: center; margin-bottom: 60px; }
.celebration-eyebrow {
  display: inline-block;
  color: var(--violet);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  margin-bottom: 10px;
}
.celebration-title {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 18px 0;
  color: var(--ink);
}
.celebration-title em { color: var(--violet); font-style: italic; }
.celebration-lead {
  font-size: 22px;
  color: var(--muted-2);
  margin: 0 0 8px 0;
}
.celebration-lead em { color: var(--violet); font-style: italic; font-weight: 500; }
.celebration-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.celebration-section { margin-bottom: 56px; }
.celebration-h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  margin: 0 0 20px 0;
  color: var(--ink);
}
.celebration-placeholder { color: var(--muted); font-style: italic; }
.celebration-audio-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--violet) 25%, var(--border));
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--ink);
  margin-bottom: 32px;
}
.celebration-audio-banner .audio-icon { color: var(--violet); flex-shrink: 0; }
.celebration-footer { text-align: center; }

/* === Summary agents grid === */
.summary-agents-grid {
  display: grid;
  gap: 16px;
}
.summary-agents-grid.n-1 { grid-template-columns: minmax(0, 480px); justify-content: center; }
.summary-agents-grid.n-2 { grid-template-columns: 1fr 1fr; }
.summary-agents-grid.n-3 { grid-template-columns: repeat(3, 1fr); }

.summary-agent-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 2px 10px -4px rgba(5, 4, 29, 0.06);
}
.summary-agent-card[data-agent-type="agendador"]     { --accent: var(--violet); --accent-soft: rgba(119, 47, 249, 0.12); }
.summary-agent-card[data-agent-type="cotizador"]     { --accent: #2D8A5F;        --accent-soft: rgba(45, 138, 95, 0.12); }
.summary-agent-card[data-agent-type="recepcionista"] { --accent: #C4632C;        --accent-soft: rgba(196, 99, 44, 0.12); }

.summary-agent-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.summary-agent-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
}
.summary-agent-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-agent-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted-2);
}
.summary-line::before { content: '· '; color: var(--accent); font-weight: 700; }

.agent-flow.is-big .flow-node { padding: 10px 12px; }

@media (max-width: 900px) {
  .summary-agents-grid.n-2, .summary-agents-grid.n-3 { grid-template-columns: 1fr; }
}

/* === Chat mockup === */
.chat-mockup {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
}
.chat-loading {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 40px 0;
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.4;
  animation: bubbleIn 0.25s var(--ease) both;
  font-size: 14px;
}
.chat-bubble.is-user {
  align-self: flex-end;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--ink);
  border-bottom-right-radius: 4px;
}
.chat-bubble.is-agent {
  align-self: flex-start;
  background: var(--violet);
  color: white;
  border-bottom-left-radius: 4px;
}
.chat-bubble.is-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
}
.chat-bubble.is-typing .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.chat-bubble.is-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.is-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dotPulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-2px); }
}

/* === Agent Intro === */
.agent-intro {
  margin-top: 24px;
  padding: 8px 0;
}
.agent-intro-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.agent-intro-icon svg {
  width: 28px;
  height: 28px;
}
.agent-intro-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.agent-intro-bullets li {
  position: relative;
  padding-left: 26px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}
.agent-intro-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* === Summary editable === */
.summary-editable {
  position: relative;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: text;
  transition: background 0.15s var(--ease);
  min-height: 40px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.summary-editable:hover {
  background: var(--accent-soft);
}
.summary-editable.is-empty {
  color: var(--muted);
  font-style: italic;
}
.summary-editable-line {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.summary-editable-hint {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
  letter-spacing: 0.3px;
}
.summary-editable:hover .summary-editable-hint {
  opacity: 1;
}
.summary-edit-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  resize: none;
  min-height: 44px;
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
  white-space: pre-wrap;
}
.summary-item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  align-items: baseline;
}
.summary-item-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* Los overrides de scroll para el cierre viven en gracias.html (página separada). */

/* === D2: Flow node detail (data-populated, scoped to is-big variant) === */
.agent-flow.is-big .flow-node { flex-direction: column; align-items: stretch; }
.agent-flow.is-big .flow-node-main { display: flex; align-items: center; gap: 10px; }
.agent-flow.is-big .flow-node-detail {
  margin-top: 4px;
  margin-left: 26px;
  font-size: 11px;
  color: var(--muted-2);
  font-style: italic;
  line-height: 1.4;
}

/* === Text input validation === */
.textfield.is-invalid {
  border-color: #c57878 !important;
  box-shadow: 0 0 0 3px rgba(197, 120, 120, 0.15);
}
.textfield-error {
  margin-top: 8px;
  font-size: 13px;
  color: #c57878;
  font-style: italic;
}
