:root {
  --bg: #1C1E21;
  --bg-alt: #15171A;
  --card: #252729;
  --card-alt: #292B2D;
  --line: #2E2F31;
  --text: #FCF5EB;
  --text-soft: #B0ACA6;
  --text-faint: #7A7876;
  --green: #25D366;
  --green-deep: #1FAA52;
  --green-tint: #1D392B;
  --green-line: #1F5B39;
  --red: #FF4D4F;
  --font: "Plus Jakarta Sans", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

/* «hidden» siempre gana, aunque el elemento tenga display propio */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }
@media (min-width: 768px) { h1 { font-size: 32px; } }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

img { max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.soft { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.mono { font-family: var(--mono); }

/* Datos pendientes de rellenar (empiezan por PENDIENTE) */
.pendiente { color: var(--red); font-weight: 600; }
.pendiente-chip {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid var(--red);
  border-radius: 999px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  word-break: break-word;
}

.boot { min-height: 100vh; display: grid; place-items: center; opacity: .6; }
.boot img { border-radius: 10px; }

/* --------------------------------------------------------------- layout */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--text); }
.brand .wordmark { height: 20px; width: auto; display: block; }
.brand-sub { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); padding-left: 10px; border-left: 1px solid var(--line); }
@media (max-width: 420px) { .brand-sub { display: none; } }
.brand:hover { text-decoration: none; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 24px; }

.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
@media (min-width: 768px) { .card { padding: 24px; } }

.card-featured { background: var(--green-tint); border-color: var(--green-line); }
.card-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-alt);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; border-color: var(--text-faint); }
.btn-primary { background: var(--green); border-color: var(--green); color: #1C1E21; }
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn-primary:disabled { background: var(--card-alt); border-color: var(--line); color: var(--text-faint); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover { color: var(--text); border-color: transparent; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-pend { border-color: var(--red); color: var(--red); background: transparent; cursor: default; }

.btn-round {
  flex: none;
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  border: 0;
  background: var(--green);
  color: #1C1E21;
  font-size: 18px; font-weight: 800;
  text-decoration: none;
}
.btn-round:hover { background: var(--green-deep); text-decoration: none; }

.linkbtn {
  border: 0; background: none; padding: 0;
  color: var(--text-soft); font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--text); }
.linkbtn:disabled { color: var(--text-faint); text-decoration: none; }

.chip {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-alt);
  font-family: var(--mono);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--text-soft);
  white-space: nowrap;
}
.chip-green { background: var(--green-tint); border-color: var(--green-line); color: var(--green); }

/* ---------------------------------------------------------------- login */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; text-align: center; }
.login-card .wordmark-lg { width: 220px; max-width: 80%; height: auto; margin: 4px auto 24px; display: block; }
.login-card form { margin-top: 24px; text-align: left; }
.login-links { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.field-label { font-weight: 600; font-size: 15px; }
.field-help { color: var(--text-soft); font-size: 13px; }
.req { color: var(--text-faint); font-family: var(--mono); font-size: 11px; margin-left: 6px; letter-spacing: .06em; }

.input, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: var(--card-alt);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus { border-color: var(--green-line); outline: 2px solid var(--green); outline-offset: 0; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input-otp {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-align: center;
  padding-left: calc(14px + 0.4em);
}

.msg { font-size: 14px; margin-top: 12px; }
.msg-error { color: var(--red); }
.msg-ok { color: var(--text-soft); }
.field-error { color: var(--red); font-size: 13px; }
.has-error .input, .has-error .textarea { border-color: var(--red); }

/* --------------------------------------------------------------- header */

.header { display: flex; gap: 16px; align-items: flex-start; }
.header .logo { width: 56px; height: 56px; border-radius: 10px; flex: none; }
.header-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.header p { margin-top: 8px; color: var(--text-soft); max-width: 70ch; }

/* ----------------------------------------------------------- bienvenida */

.welcome-card { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 640px) { .welcome-card { flex-direction: row; align-items: flex-start; } }
.play {
  flex: none;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #1C1E21;
  font-size: 22px;
}

/* --------------------------------------------------------------- banner */

.banner { display: flex; flex-direction: column; gap: 10px; }

/* -------------------------------------------------------------- progreso */

.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.progress-bar { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 6px; }
.seg { height: 10px; border-radius: 999px; background: var(--line); border: 1px solid var(--line); }
.seg.done { background: var(--green); border-color: var(--green); }
.seg.current { background: var(--green-deep); border-color: var(--green-line); box-shadow: inset 0 0 0 1px var(--green-line); }

/* -------------------------------------------------------- coaching card */

.coach { display: flex; align-items: center; gap: 14px; color: var(--text); }
.coach:hover { text-decoration: none; }
.coach .ico { font-size: 26px; flex: none; }
.coach .body { flex: 1; min-width: 0; }
.coach .count { font-family: var(--mono); font-size: 12px; color: var(--green); margin-top: 2px; letter-spacing: .04em; }

/* ----------------------------------------------------------- fase actual */

.phase-title { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
.phase-title .ico { font-size: 28px; line-height: 1.1; flex: none; }
.phase-title p { color: var(--text-soft); margin-top: 2px; }

.wait { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-alt); }
.wait-head { display: flex; gap: 10px; align-items: flex-start; }
.wait ul { list-style: none; padding: 0; margin: 12px 0 16px; }
.wait li + li { margin-top: 8px; }

.steps { list-style: none; padding: 0; margin: 12px 0 0; counter-reset: step; }
.step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; }
.step-num {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--card-alt);
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--text-soft);
}
.step-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.step-body a { color: var(--text); font-weight: 600; }
.step-body a:hover { color: var(--green); }
.step-body .t { font-weight: 600; }
.step.done .step-body a, .step.done .step-body .t { text-decoration: line-through; color: var(--text-faint); }

.check {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--text-faint);
  background: var(--card-alt);
  color: transparent;
  font-size: 16px; font-weight: 800; line-height: 1;
  padding: 0;
}
.check[aria-checked="true"] { background: var(--green); border-color: var(--green); color: #1C1E21; }
.check:disabled { opacity: .6; }

/* -------------------------------------------------------------- recursos */

.res { list-style: none; padding: 0; margin: 0; }
.res li { border-top: 1px solid var(--line); }
.res li:first-child { border-top: 0; }
.res-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; color: var(--text); }
a.res-item:hover { text-decoration: none; }
a.res-item:hover .res-t { color: var(--green); }
.res-ico { font-size: 20px; width: 28px; text-align: center; flex: none; line-height: 1.4; }
.res-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.res-t { font-weight: 600; }
.res-d { color: var(--text-soft); font-size: 13px; }
.res-arrow { color: var(--text-faint); flex: none; }
.res-item.locked, .res-item.locked .res-t { color: var(--text-faint); }

/* ------------------------------------------------------------ recorrido */

.journey { list-style: none; padding: 0; margin: 0; }
.journey li + li { margin-top: 8px; }
.j-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-alt);
  color: var(--text);
}
a.j-item:hover { text-decoration: none; border-color: var(--green-line); }
.j-dot {
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; font-weight: 600;
}
.j-item.done .j-dot { background: var(--green); border-color: var(--green); color: #1C1E21; }
.j-item.current .j-dot { border-color: var(--green-line); color: var(--green); background: var(--green-tint); }
.j-item.locked { opacity: .55; }
.j-main { flex: 1; min-width: 0; }
.j-main .t { font-weight: 600; overflow-wrap: anywhere; }
.j-main .s { font-size: 13px; color: var(--text-soft); }
.j-right { display: flex; align-items: center; gap: 10px; flex: none; }
@media (max-width: 480px) { .j-right .chip { display: none; } }

/* ----------------------------------------------------------- formulario */

.back {
  position: sticky; top: 0; z-index: 15;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.back-inner { max-width: 1100px; margin: 0 auto; padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.form-wrap { max-width: 760px; }

.tabs {
  display: flex; gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  margin-left: -2px;
  margin-right: -2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-soft);
  font-weight: 600; font-size: 14px;
  white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--green-tint); border-color: var(--green-line); color: var(--green); }
.tabs-sticky { position: sticky; top: 53px; z-index: 10; background: var(--bg); padding-top: 8px; padding-bottom: 8px; }

.section { scroll-margin-top: 130px; }
.section h2 { margin-bottom: 16px; }
.q + .q { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-alt);
  color: var(--text);
  font-size: 14px; font-weight: 500;
}
.chip-opt:hover { border-color: var(--text-faint); }
.chip-opt[aria-checked="true"] { background: var(--green-tint); border-color: var(--green-line); color: var(--green); font-weight: 600; }
.chip-ro { cursor: default; }
.chip-ro:hover { border-color: var(--green-line); }

.answer {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-alt);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.submit-bar { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.submit-hint { display: flex; gap: 6px; align-items: center; justify-content: center; color: var(--text-faint); font-size: 13px; text-align: center; }
.draft-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------ recurso embebido */

.embed-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.embed {
  display: block;
  width: 100%;
  height: calc(100vh - 53px - 32px);
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

/* ---------------------------------------------------------------- modal */

.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 11, 12, .72);
  display: grid; place-items: center;
  padding: 16px;
}
.modal {
  width: 100%; max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.modal-head { background: var(--green-tint); border-bottom: 1px solid var(--green-line); padding: 24px; text-align: center; border-radius: 10px 10px 0 0; }
.modal-ok {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--green); color: #1C1E21;
  font-size: 26px; font-weight: 800;
}
.modal-body { padding: 24px; }
.modal-body .btn + .btn { margin-top: 10px; }

/* -------------------------------------------------------------- coaching */

.session-meta { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 16px; }
.rich { overflow-wrap: anywhere; }
.rich > * + * { margin-top: 12px; }
.rich h1, .rich h2, .rich h3 { font-size: 17px; }
.rich ul, .rich ol { padding-left: 22px; margin: 0; }
.rich a { text-decoration: underline; }
.rich img { height: auto; border-radius: 8px; }
.rich blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--green-line); color: var(--text-soft); }
.rich table { border-collapse: collapse; display: block; overflow-x: auto; }
.rich td, .rich th { border: 1px solid var(--line); padding: 6px 8px; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-soft); }
.empty .ico { font-size: 32px; display: block; margin-bottom: 8px; }

/* ----------------------------------------------------- loading y errores */

.skel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(252, 245, 235, .04), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }

.error-box { text-align: center; padding: 32px 20px; }
.error-box p { color: var(--red); margin-bottom: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60;
  transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-alt);
  color: var(--text);
  font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ------------------------------------------------- WhatsUpFunnel™ AI */

.ai-card .ico img { width: 34px; height: 34px; border-radius: 8px; display: block; }

.ai-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.ai-top {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.ai-top .ai-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.ai-top .ai-title img { width: 26px; height: 26px; border-radius: 6px; flex: none; }
.ai-top .ai-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-toggle { display: inline-flex; }
@media (min-width: 900px) { .ai-toggle { display: none; } }

.ai-body { flex: 1; min-height: 0; display: flex; position: relative; }

.ai-side {
  width: 280px; flex: none;
  display: flex; flex-direction: column;
  background: var(--bg-alt);
  border-right: 1px solid var(--line);
  min-height: 0;
}
.ai-scrim { display: none; }
@media (max-width: 899px) {
  .ai-side {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 30;
    width: min(320px, 86vw);
    transform: translateX(-102%);
    transition: transform .2s;
  }
  .ai-side.open { transform: none; }
  .ai-scrim { position: absolute; inset: 0; z-index: 25; background: rgba(10, 11, 12, .6); }
  .ai-scrim.open { display: block; }
}
.ai-side-head { padding: 12px; border-bottom: 1px solid var(--line); }
.ai-convs { flex: 1; overflow-y: auto; padding: 8px; list-style: none; margin: 0; }
.ai-conv { border-radius: 8px; }
.ai-conv + .ai-conv { margin-top: 2px; }
.ai-conv-row { display: flex; align-items: center; gap: 4px; }
.ai-conv button.sel {
  flex: 1; min-width: 0; text-align: left;
  border: 0; background: none; padding: 9px 10px; border-radius: 8px;
  color: var(--text-soft);
}
.ai-conv button.sel .t { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-conv button.sel .d { display: block; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.ai-conv:hover, .ai-conv.active { background: var(--card); }
.ai-conv.active button.sel { color: var(--text); }
.ai-conv .more { flex: none; border: 0; background: none; color: var(--text-faint); padding: 6px 8px; border-radius: 6px; font-size: 16px; line-height: 1; }
.ai-conv .more:hover { color: var(--text); background: var(--card-alt); }
.ai-conv-actions { display: flex; gap: 6px; padding: 0 10px 8px; }
.ai-side-foot { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-faint); }

.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.ai-msgs-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.ai-empty { text-align: center; padding: 24px 8px; max-width: 560px; margin: 0 auto; }
.ai-empty img { width: 56px; height: 56px; border-radius: 12px; margin: 0 auto 12px; display: block; }
.ai-empty p { color: var(--text-soft); margin-top: 6px; }
.ai-sugs { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; text-align: left; }
.ai-sug {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font-size: 14px; text-align: left;
}
.ai-sug:hover { border-color: var(--green-line); background: var(--green-tint); }

.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg.user { justify-content: flex-end; }
.ai-avatar { width: 28px; height: 28px; border-radius: 7px; flex: none; margin-top: 2px; }
.ai-bubble { min-width: 0; overflow-wrap: anywhere; }
.ai-msg.user .ai-bubble {
  max-width: 85%;
  background: var(--card-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  white-space: pre-wrap;
}
.ai-origen { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: .06em; margin-bottom: 2px; }
.ai-msg.assistant .ai-bubble { flex: 1; }
.ai-text > * + * { margin-top: 10px; }
.ai-text ul, .ai-text ol { padding-left: 22px; margin: 0; }
.ai-text li + li { margin-top: 4px; }
.ai-text h3, .ai-text h4 { font-size: 15px; font-weight: 700; }
.ai-text code { font-family: var(--mono); font-size: 13px; background: var(--card-alt); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.ai-text pre { background: var(--card-alt); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; }
.ai-text pre code { border: 0; padding: 0; background: none; }
.ai-text a { text-decoration: underline; text-underline-offset: 2px; }
.ai-text blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--green-line); color: var(--text-soft); }

.ai-typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: aiDot 1.2s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-typing i, .ai-rec .dot { animation: none; opacity: .6; } }

.ai-fuentes { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.ai-fuente { font-family: var(--mono); font-size: 12px; color: var(--text-soft); overflow-wrap: anywhere; }
.ai-fuente a { color: var(--green); }

.ai-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }
.ai-act {
  border: 1px solid transparent; background: none; color: var(--text-faint);
  border-radius: 8px; padding: 4px 8px; font-size: 13px; min-height: 30px;
}
.ai-act:hover { color: var(--text); background: var(--card); }
.ai-act[aria-pressed="true"] { color: var(--green); border-color: var(--green-line); background: var(--green-tint); }
.ai-fb-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ai-fb-form .input { flex: 1; min-width: 180px; min-height: 38px; padding: 8px 12px; font-size: 14px; }

.ai-aviso {
  margin-top: 8px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--text-soft);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.ai-aviso.err { border-color: var(--red); color: var(--red); }

.ai-compose { flex: none; border-top: 1px solid var(--line); background: var(--bg); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.ai-compose-inner { max-width: 760px; margin: 0 auto; }
.ai-box {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px;
}
.ai-box:focus-within { border-color: var(--green-line); }
.ai-box textarea {
  flex: 1; min-width: 0; resize: none; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.45; padding: 8px; max-height: 180px;
}
.ai-box textarea:focus { outline: none; }
.ai-box textarea::placeholder { color: var(--text-faint); }
.ai-icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  border: 0; background: var(--card-alt); color: var(--text-soft); font-size: 17px;
}
.ai-icon-btn:hover { color: var(--text); }
.ai-icon-btn.send { background: var(--green); color: #1C1E21; font-weight: 800; }
.ai-icon-btn.send:hover { background: var(--green-deep); }
.ai-icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.ai-icon-btn.rec { background: var(--red); color: var(--text); }
.ai-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 11px; color: var(--text-faint); flex-wrap: wrap; }
.ai-rec { display: flex; align-items: center; gap: 10px; flex: 1; padding: 8px; color: var(--text-soft); font-family: var(--mono); font-size: 14px; }
.ai-rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: aiDot 1s infinite; }

/* =====================================================================
   Capa de marca WUF UI (guía del CRM ventas.whatsupfunnel.io)
   Solo aspecto visual: misma estructura, mismas ubicaciones.
   Para volver al estilo anterior basta con borrar este bloque.
   ===================================================================== */

:root {
  --font: "Poppins", Arial, sans-serif;
  --mono: "Poppins", Arial, sans-serif;
  --code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-card: 14px;
  --r-hero: 16px;
  --r-btn: 10px;
  --r-ibox: 9px;
}

body { font-size: 15px; line-height: 1.6; }
.mono, .label, .chip, .count, .progress-head .label, .kpi .v { font-variant-numeric: tabular-nums; }

/* Tipografía: títulos con el peso de la guía */
h1 { font-size: 21px; font-weight: 600; letter-spacing: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.35; }
h3 { font-size: 15px; font-weight: 600; }
@media (min-width: 768px) { h1 { font-size: 24px; } }

/* Etiquetas en mayúsculas: Poppins, .07em y mejor contraste */
.label { font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .07em; color: var(--text-soft); }
.brand-sub { font-family: var(--font); letter-spacing: .07em; color: var(--text-soft); }
.pendiente-chip { font-family: var(--font); font-weight: 500; }

/* Medidas y espaciado */
.topbar-inner, .wrap, .back-inner { max-width: 1240px; }
@media (min-width: 900px) {
  .topbar-inner, .back-inner { padding-left: 32px; padding-right: 32px; }
  .wrap { padding-left: 32px; padding-right: 32px; }
}
.stack-lg > * + * { margin-top: 14px; }
.grid-2 { gap: 12px; }
.form-wrap { max-width: 800px; }

/* Tarjetas */
.card { border-radius: var(--r-card); padding: 16px; }
@media (min-width: 768px) { .card { padding: 20px; } }
.card-featured { border-radius: var(--r-hero); }
.card-head { margin-bottom: 14px; }

/* Tarjeta héroe: el progreso del programa */
.hero {
  background: linear-gradient(135deg, var(--green-tint), var(--card) 70%);
  border-color: var(--green-line);
  border-radius: var(--r-hero);
}
.hero .progress-head .label { font-size: 12px; color: var(--green); }
.progress-bar { gap: 6px; }
.seg { height: 14px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); }
.seg.done { background: linear-gradient(90deg, var(--green-deep), var(--green)); border-color: var(--green-deep); }
.seg.current { background: var(--green-tint); border-color: var(--green-line); box-shadow: inset 0 0 0 1px var(--green-line); }

/* Botones, campos y pastillas */
.btn { border-radius: var(--r-btn); font-weight: 600; }
.btn-primary { color: var(--bg-alt); }
.input, .textarea { border-radius: var(--r-btn); }
.chip { font-family: var(--font); font-weight: 600; letter-spacing: .05em; }
.tab { font-weight: 500; font-size: 13.5px; }
.tab:hover { color: var(--text); border-color: var(--green-line); }
.tab[aria-selected="true"] { background: var(--green); border-color: var(--green); color: var(--bg-alt); font-weight: 600; }
.chip-opt { font-weight: 500; }

/* Cajas de icono (iconos dentro de un cuadrado, como en la guía) */
.coach .ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--green-tint); border: 1px solid var(--green-line); font-size: 20px; line-height: 1;
}
.card-featured .coach .ico { background: var(--green-line); }
.ai-card .ico img { width: 26px; height: 26px; border-radius: 6px; }
.phase-title .ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--green-tint); border: 1px solid var(--green-line); font-size: 21px; line-height: 1;
}
.res-item { align-items: center; }
.res-ico {
  width: 32px; height: 32px; border-radius: var(--r-ibox); display: grid; place-items: center;
  background: var(--card-alt); border: 1px solid var(--line); font-size: 16px; line-height: 1;
}
.res-item.locked .res-ico { opacity: .7; }
.step-num { font-family: var(--font); font-weight: 600; }
.check { border-radius: 8px; width: 30px; height: 30px; }
.j-item { border-radius: 12px; }
.j-dot { font-family: var(--font); }
.wait { border-radius: 12px; }

/* Cabecera del alumno: logo en cuadrado */
.header .logo { border-radius: 12px; border: 1px solid var(--line); }

/* Login y modal */
.login-card { border-radius: var(--r-hero); }
.modal { border-radius: var(--r-hero); }
.modal-head { border-radius: var(--r-hero) var(--r-hero) 0 0; }
.input-otp { font-family: var(--font); font-weight: 600; letter-spacing: .35em; }

/* Coaching Log y recorrido */
.answer { border-radius: 12px; }
.rich blockquote { border-left-color: var(--green); }

/* WhatsUpFunnel™ AI */
.ai-box { border-radius: 14px; }
.ai-sug { border-radius: 12px; }
.ai-msg.user .ai-bubble { border-radius: 14px 14px 4px 14px; }
.ai-avatar { border-radius: 8px; }
.ai-text code, .ai-text pre { font-family: var(--code); }
.ai-act { min-height: 36px; }
.ai-icon-btn { border-radius: 12px; }
.ai-origen, .ai-fuente { font-family: var(--font); }
.ai-conv { border-radius: 10px; }

/* Avisos flotantes: por encima de la caja de escribir del chat */
.toast { border-radius: 12px; }
body:has(.ai-page) .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------------------------------------- Iconos SVG (centrado exacto) */

.icon { display: block; flex: none; }
.btn .icon { display: inline-block; vertical-align: middle; }
.btn-round { display: grid; place-items: center; line-height: 0; }
.btn-round .icon { width: 20px; height: 20px; }
.ai-icon-btn { line-height: 0; }
.check { line-height: 0; }
.check .icon { stroke-width: 3; }
.play { line-height: 0; }
.play .icon { margin-left: 3px; }
.modal-ok { line-height: 0; }
.modal-ok .icon { stroke-width: 3; }
.j-dot { line-height: 0; }
.j-item.done .j-dot .icon { stroke-width: 3; }
.j-go { display: inline-grid; place-items: center; color: var(--text-faint); }
a.j-item:hover .j-go { color: var(--green); }
.card.empty > .ico { display: grid; place-items: center; color: var(--text-faint); }
.card.empty > .ico .icon { margin: 0 auto 8px; }

/* Enlace externo dentro de un texto: icono pequeño alineado con la línea */
.ext { display: inline-flex; align-items: center; gap: 5px; }
.ext .icon { flex: none; }
.ai-fuente .ext { gap: 4px; }

/* Botón redondo de «abrir enlace» junto al check de cada paso */
.icon-link {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center; line-height: 0;
  border-radius: 999px;
  background: var(--green-tint);
  border: 1px solid var(--green-line);
  color: var(--green);
  transition: background-color .15s, color .15s;
}
.icon-link:hover { background: var(--green); color: var(--bg-alt); text-decoration: none; }
.step { gap: 10px; }

/* Flecha o enlace al final de cada recurso */
.res-arrow { display: grid; place-items: center; color: var(--text-faint); line-height: 0; }
a.res-item:hover .res-arrow { color: var(--green); }
.res-ico .icon { color: var(--text-faint); }

/* Fecha y grabación en el Coaching Log */
.meta-ico { display: inline-flex; align-items: center; gap: 6px; }
.session-meta .btn .icon:first-child { margin-right: -2px; }

/* Chat */
.ai-origen { display: inline-flex; align-items: center; gap: 4px; }
.ai-act { display: inline-flex; align-items: center; gap: 6px; }
.ai-conv .more { display: grid; place-items: center; line-height: 0; }
.ai-top .btn { gap: 6px; }

/* Titular del panel */
.header-tip { color: var(--text-faint); font-style: italic; }

@media (max-width: 520px) {
  .header { gap: 12px; }
  .header .logo { width: 44px; height: 44px; border-radius: 10px; }
}

/* Descripción de la cabecera a todo el ancho (sin hueco a la derecha) */
.header > div { flex: 1; min-width: 0; }
.header p { max-width: none; }
