:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #14213d;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #f59e0b;
  --soft-blue: #eff6ff;
  --soft-green: #f0fdf4;
  --soft-amber: #fffbeb;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(20,33,61,.08);
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); }
body { margin: 0; line-height: 1.55; }
a { color: inherit; }
.site-bg { background: var(--bg); min-height: 100vh; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { max-width: 820px; }
.course-header, .lesson-header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.header-row, .lesson-header-row { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.course-header .header-row { padding-top: 10px; padding-bottom: 14px; }
.brand { font-size: 1.2rem; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.header-subtitle { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.user-menu { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; }
.user-menu--index { flex-wrap: wrap; justify-content: flex-end; gap: 10px 12px; }
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 4px 0;
  color: #475467;
  font-size: .84rem;
}
.user-pill__avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg,#eef4ff,#dbeafe);
  color: #1d4ed8;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.10);
}
.user-pill__name { font-weight: 700; color: #344054; }
.index-top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.menu-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(16,24,40,.02);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.menu-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(15,23,42,.07);
}
.menu-link__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.menu-link--profile .menu-link__icon { background: #e0ecff; color: #175cd3; }
.menu-link--resources .menu-link__icon { background: #dcfce7; color: #15803d; }
.menu-link--method .menu-link__icon { background: #ede9fe; color: #6d28d9; }
.menu-link--notes .menu-link__icon { background: #fff3d8; color: #c2410c; }
.menu-link--tutorials .menu-link__icon { background: #ffe4e6; color: #be123c; }
.menu-link--logout .menu-link__icon { background: #f2f4f7; color: #475467; font-size: .75rem; }
.menu-link--profile:hover { border-color: #bfdbfe; background: #f8fbff; }
.menu-link--resources:hover { border-color: #bbf7d0; background: #f6fef8; }
.menu-link--method:hover { border-color: #ddd6fe; background: #faf8ff; }
.menu-link--notes:hover { border-color: #fde68a; background: #fffdf6; }
.menu-link--tutorials:hover { border-color: #fecdd3; background: #fff8f8; }
.menu-link--logout:hover { border-color: #d0d5dd; background: #f8fafc; }
.main-space { padding: 34px 0 60px; }
.progress-hero { background: linear-gradient(135deg,#172554,#1d4ed8); color: white; border-radius: 24px; padding: 30px; display: grid; grid-template-columns: 1fr auto; gap: 18px 28px; box-shadow: var(--shadow); }
.progress-hero h1 { margin: 5px 0 8px; font-size: clamp(1.7rem,3vw,2.45rem); line-height: 1.08; }
.progress-hero p { margin: 0; color: #dbeafe; max-width: 760px; }
.eyebrow { margin: 0 0 7px; font-size: .73rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: #2563eb; }
.progress-hero .eyebrow { color: #bfdbfe; }
.global-progress { display: flex; flex-direction: column; text-align: right; justify-content: center; }
.global-progress strong { font-size: 2rem; }
.global-progress span { color: #bfdbfe; font-size: .8rem; }
.progress-track { height: 9px; background: rgba(255,255,255,.22); border-radius: 999px; overflow: hidden; grid-column: 1 / -1; }
.progress-track.compact { background: #edf0f4; margin-top: 18px; height: 7px; }
.progress-fill { height: 100%; background: #60a5fa; border-radius: inherit; transition: width .3s ease; }
.compact .progress-fill { background: var(--success); }
.module-list { display: grid; gap: 18px; margin-top: 22px; }
.module-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 8px 24px rgba(20,33,61,.04); }
.module-card h1, .module-card h2 { margin-top: 0; }
.module-head { display: flex; justify-content: space-between; gap: 28px; }
.module-head h2 { margin: 10px 0 6px; font-size: 1.15rem; }
.module-head p { margin: 0; color: var(--muted); max-width: 770px; }
.module-progress { min-width: 110px; display: flex; flex-direction: column; text-align: right; }
.module-progress strong { font-size: 1.35rem; }
.module-progress span { font-size: .78rem; color: var(--muted); }
.status-pill { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #f2f4f7; color: #667085; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.status-pill.status-open { background: var(--soft-amber); color: #a16207; }
.status-pill.status-done { background: var(--soft-green); color: #15803d; }
.lesson-list { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin-top: 17px; }
.lesson-row { display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 12px; padding: 13px 15px; text-decoration: none; border-top: 1px solid var(--line); transition: background .15s ease; }
.lesson-row:first-child { border-top: 0; }
.lesson-row:hover { background: #f8fafc; }
.lesson-state { width: 9px; height: 9px; border-radius: 50%; background: #d0d5dd; }
.lesson-state.lesson-open { background: var(--warning); }
.lesson-state.lesson-done { background: var(--success); }
.lesson-title { font-weight: 600; font-size: .91rem; }
.lesson-percent { color: var(--muted); font-size: .79rem; }
.lesson-action { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: .78rem; background: white; }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: .87rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--text); border-color: var(--line); }
.btn-small { padding: 7px 10px; font-size: .78rem; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px,100%); background: white; border: 1px solid var(--line); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 7px 0; }
.auth-foot { margin: 20px 0 0; color: var(--muted); font-size: .86rem; }
.muted { color: var(--muted); }
.form-stack { display: grid; gap: 15px; margin-top: 22px; }
.form-stack label { display: grid; gap: 6px; font-size: .84rem; font-weight: 700; }
.form-stack input, .form-stack select, .form-stack textarea { width: 100%; padding: 11px 12px; border: 1px solid #d0d5dd; border-radius: 10px; font: inherit; background: white; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { outline: 3px solid #dbeafe; border-color: #60a5fa; }
.form-error { color: #b42318; background: #fef3f2; padding: 10px 12px; border-radius: 10px; margin: 0; font-size: .83rem; }
.form-note { color: #175cd3; background: #eff8ff; padding: 10px 12px; border-radius: 10px; margin: 0; font-size: .83rem; }
.lesson-header-row { min-height: 62px; }
.back-link, .tutor-link { font-weight: 700; font-size: .84rem; text-decoration: none; }
.lesson-module { color: var(--muted); font-size: .82rem; text-align: center; }
.lesson-shell { width: min(900px,calc(100% - 32px)); margin: 32px auto 60px; }
.lesson-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px,4vw,46px); box-shadow: 0 8px 28px rgba(20,33,61,.05); }
.lesson-card h1 { margin: 4px 0 24px; line-height: 1.14; font-size: clamp(1.8rem,4vw,2.6rem); }
.lesson-content { color: #344054; font-size: 1.02rem; }
.lesson-content h2 { color: var(--text); margin: 30px 0 10px; }
.lesson-content p { margin: 0 0 16px; }
.lesson-content ul { margin: 0 0 20px; padding-left: 22px; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.lesson-nav > div:last-child { text-align: right; }
.ia-block { border-left: 4px solid #f59e0b; background: var(--soft-amber); padding: 18px; border-radius: 13px; margin: 24px 0; }
.ia-block__header { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 800; color: #92400e; }
.ia-block__content { margin-top: 8px; font-size: .92rem; color: #475467; }
.ia-block__content p:last-child { margin-bottom: 0; }
.info-box { border: 1px solid #bfdbfe; background: var(--soft-blue); border-radius: 14px; padding: 18px; margin: 22px 0; }
.info-box strong { color: #1d4ed8; }
.thread-list { display: grid; gap: 10px; margin-top: 15px; }
.thread-row { display: flex; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.thread-row div { display: grid; }
.thread-row span { font-size: .76rem; color: var(--muted); }
@media (max-width: 720px) {
  .header-row, .module-head { align-items: flex-start; flex-direction: column; }
  .user-menu { flex-wrap: wrap; }
  .user-menu--index { align-items: flex-start; }
  .index-top-nav { width: 100%; }
  .menu-link { flex: 1 1 calc(50% - 8px); justify-content: flex-start; }
  .user-pill { padding-bottom: 0; }
  .progress-hero { grid-template-columns: 1fr; }
  .global-progress { text-align: left; }
  .lesson-row { grid-template-columns: 10px 1fr auto; }
  .lesson-percent { display: none; }
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav > div:last-child { text-align: left; }
  .lesson-header-row { flex-wrap: wrap; padding: 10px 0; }
  .lesson-module { order: 3; width: 100%; }
}


/* Estado de lecciones aun no publicadas */
.lesson-row.is-upcoming { cursor: default; opacity: .68; background: #fafafa; }
.lesson-row.is-upcoming:hover { background: #fafafa; }
.lesson-state.lesson-upcoming { background: #98a2b3; }
.lesson-action.is-disabled { color: #667085; background: #f2f4f7; }

/* Diagnostico */
.diagnostic-grid { display: grid; gap: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.choice-card { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: white; }
.choice-card input { margin-right: 7px; }
.ai-result { margin-top: 20px; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: #fff7ed; color: #9a3412; padding: 5px 9px; font-size: .73rem; font-weight: 800; }
.hidden { display: none !important; }
@media (max-width: 720px) { .choice-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Herramientas de estudio: subrayados, notas, tutor e IA
   ========================================================= */
.lesson-tools-nav { display: flex; align-items: center; gap: 10px; }
.lesson-tool-link { border: 0; background: transparent; color: var(--text); font-weight: 700; font-size: .84rem; padding: 0; text-decoration: none; }
.lesson-tool-link:hover, .tutor-link:hover { color: var(--primary); }
.lesson-tool-link span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 3px; padding: 0 5px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: .68rem; }
.lesson-study-hint { margin: -8px 0 24px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.mp-study-block { position: relative; }
.mp-highlight { background: #fef08a; color: inherit; border-radius: 3px; padding: 0 .06em; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .18s ease, box-shadow .18s ease; }
.mp-highlight:hover { background: #fde047; }
.mp-highlight.has-note { background: #fde68a; box-shadow: inset 0 -2px 0 #f59e0b; }
.mp-highlight.is-focused { background: #facc15; box-shadow: 0 0 0 4px rgba(250,204,21,.24); }

.study-selection-toolbar { position: absolute; z-index: 80; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 11px; background: #111827; color: white; box-shadow: 0 12px 34px rgba(15,23,42,.28); }
.study-selection-toolbar[hidden] { display: none; }
.study-selection-toolbar button { border: 0; background: transparent; color: #e5e7eb; padding: 7px 9px; border-radius: 7px; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.study-selection-toolbar button:hover { background: rgba(255,255,255,.10); color: white; }
.study-selection-toolbar button.is-ai { color: #fde68a; }

.study-drawer-overlay { position: fixed; inset: 0; z-index: 89; background: rgba(15,23,42,.28); backdrop-filter: blur(1px); }
.study-drawer-overlay[hidden] { display: none; }
.study-drawer { position: fixed; z-index: 90; top: 0; right: 0; width: min(440px, 94vw); height: 100vh; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(15,23,42,.14); transform: translateX(102%); transition: transform .22s ease; }
.study-drawer.is-open { transform: translateX(0); }
.study-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); }
.study-drawer-head h2 { margin: 4px 0 0; font-size: 1.16rem; }
.study-kicker { color: #6b7280; font-size: .66rem; font-weight: 850; letter-spacing: .11em; }
.study-icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 1.25rem; line-height: 1; }
.study-icon-button:hover { color: var(--text); background: #f8fafc; }
.study-notes-list { flex: 1; overflow: auto; padding: 16px; display: grid; align-content: start; gap: 10px; }
.study-note-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: #fffdf4; }
.study-note-jump { display: block; width: 100%; border: 0; padding: 0; background: transparent; text-align: left; color: #475467; font-size: .8rem; line-height: 1.45; font-style: italic; }
.study-note-jump:hover { color: var(--text); }
.study-note-card p { margin: 9px 0 0; font-size: .8rem; color: var(--text); line-height: 1.5; }
.study-note-card p.study-note-muted { color: var(--muted); font-size: .74rem; }
.study-note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #f2e9bf; }
.study-note-actions button { border: 0; border-radius: 7px; padding: 5px 7px; background: #f8fafc; color: #475467; font-size: .67rem; font-weight: 750; }
.study-note-actions button:hover { background: #eef2f6; color: var(--text); }
.study-note-actions button.is-danger { color: #b42318; margin-left: auto; }
.study-empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.study-drawer-foot { border-top: 1px solid var(--line); padding: 15px 20px; }
.study-drawer-foot a { color: var(--primary); font-weight: 750; font-size: .8rem; text-decoration: none; }

.study-dialog { width: min(650px, calc(100% - 28px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 30px 90px rgba(15,23,42,.24); }
.study-dialog::backdrop { background: rgba(15,23,42,.42); backdrop-filter: blur(2px); }
.study-dialog-card { padding: 22px; }
.study-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.study-dialog-head h2 { margin: 4px 0 0; font-size: 1.22rem; }
.study-quote { margin: 18px 0; padding: 13px 15px; border-left: 3px solid #f59e0b; border-radius: 0 9px 9px 0; background: #fffbeb; color: #475467; font-size: .83rem; line-height: 1.5; }
.study-field { display: grid; gap: 7px; color: var(--text); font-size: .78rem; font-weight: 750; }
.study-field textarea { width: 100%; padding: 11px 12px; border: 1px solid #d0d5dd; border-radius: 10px; font: inherit; line-height: 1.5; resize: vertical; }
.study-field textarea:focus { outline: 3px solid #dbeafe; border-color: #60a5fa; }
.study-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.study-error { margin: 12px 0 0; padding: 9px 11px; border-radius: 9px; background: #fef3f2; color: #b42318; font-size: .76rem; }
.study-ai-answer { margin-top: 15px; padding: 16px; border-left: 4px solid #f59e0b; border-radius: 11px; background: #fffbeb; color: #475467; }
.study-ai-label { color: #92400e; font-size: .72rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.study-ai-answer #mpAiAnswerText { margin-top: 9px; white-space: pre-wrap; font-size: .86rem; line-height: 1.58; }
.study-ai-answer small { display: block; margin-top: 11px; color: #78716c; font-size: .68rem; }
.study-toast { position: fixed; z-index: 110; left: 50%; bottom: 24px; transform: translateX(-50%); border-radius: 999px; background: #111827; color: white; padding: 10px 15px; font-size: .76rem; font-weight: 700; box-shadow: 0 12px 30px rgba(15,23,42,.24); }
.study-toast[hidden] { display: none; }

/* Cuaderno general */
.notebook-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.notebook-head h1 { margin: 4px 0 6px; }
.notebook-summary { color: var(--muted); font-size: .86rem; }
.notebook-group { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 15px; }
.notebook-group-head { padding: 16px 18px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.notebook-group-head strong { display: block; }
.notebook-group-head span { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; }
.notebook-item { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.notebook-item:last-child { border-bottom: 0; }
.notebook-item blockquote { margin: 0; color: #475467; font-size: .82rem; font-style: italic; }
.notebook-item p { margin: 8px 0 0; font-size: .84rem; }
.notebook-item-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: .69rem; }
.notebook-item-foot a { color: var(--primary); font-weight: 750; text-decoration: none; }

@media (max-width: 720px) {
  .lesson-tools-nav { width: 100%; justify-content: space-between; }
  .study-selection-toolbar { max-width: calc(100vw - 16px); overflow-x: auto; }
  .study-selection-toolbar button { padding: 7px 8px; }
  .study-selection-toolbar.is-mobile-selection {
    position: fixed;
    z-index: 120;
    left: 8px !important;
    right: 8px;
    top: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    padding: 7px;
    border-radius: 14px;
    justify-content: space-between;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .study-selection-toolbar.is-mobile-selection button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 11px;
    font-size: .74rem;
    touch-action: manipulation;
  }
  .notebook-head { flex-direction: column; }
}

/* =========================================================
   Respuestas de IA: contenido enriquecido (Markdown seguro)
   ========================================================= */
.ai-rich-content,
.study-ai-answer #mpAiAnswerText {
  color: #344054;
  font-size: .9rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
}
.ai-rich-content > :first-child,
.study-ai-answer #mpAiAnswerText > :first-child { margin-top: 0; }
.ai-rich-content > :last-child,
.study-ai-answer #mpAiAnswerText > :last-child { margin-bottom: 0; }
.ai-rich-content p,
.study-ai-answer #mpAiAnswerText p { margin: 0 0 13px; }
.ai-rich-content h3,
.ai-rich-content h4,
.ai-rich-content h5,
.study-ai-answer #mpAiAnswerText h3,
.study-ai-answer #mpAiAnswerText h4,
.study-ai-answer #mpAiAnswerText h5 {
  color: #101828;
  line-height: 1.28;
  letter-spacing: -.01em;
}
.ai-rich-content h3,
.study-ai-answer #mpAiAnswerText h3 { margin: 24px 0 10px; font-size: 1.06rem; }
.ai-rich-content h4,
.study-ai-answer #mpAiAnswerText h4 { margin: 20px 0 9px; font-size: .98rem; }
.ai-rich-content h5,
.study-ai-answer #mpAiAnswerText h5 { margin: 18px 0 8px; font-size: .92rem; }
.ai-rich-content ul,
.ai-rich-content ol,
.study-ai-answer #mpAiAnswerText ul,
.study-ai-answer #mpAiAnswerText ol { margin: 9px 0 16px; padding-left: 1.45rem; }
.ai-rich-content li,
.study-ai-answer #mpAiAnswerText li { margin: 5px 0; padding-left: 2px; }
.ai-rich-content li::marker,
.study-ai-answer #mpAiAnswerText li::marker { color: #667085; font-weight: 700; }
.ai-rich-content strong,
.study-ai-answer #mpAiAnswerText strong { color: #1d2939; font-weight: 750; }
.ai-rich-content em,
.study-ai-answer #mpAiAnswerText em { color: #475467; }
.ai-rich-content blockquote,
.study-ai-answer #mpAiAnswerText blockquote {
  margin: 16px 0;
  padding: 11px 14px;
  border-left: 3px solid #94a3b8;
  border-radius: 0 9px 9px 0;
  background: rgba(255,255,255,.58);
  color: #475467;
}
.ai-rich-content blockquote p,
.study-ai-answer #mpAiAnswerText blockquote p { margin: 0; }
.ai-rich-content code,
.study-ai-answer #mpAiAnswerText code {
  padding: .12em .36em;
  border-radius: 5px;
  background: #f2f4f7;
  color: #344054;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .86em;
}
.ai-rich-content pre,
.study-ai-answer #mpAiAnswerText pre {
  margin: 16px 0;
  padding: 14px 15px;
  overflow-x: auto;
  border-radius: 11px;
  background: #101828;
  color: #f8fafc;
}
.ai-rich-content pre code,
.study-ai-answer #mpAiAnswerText pre code { padding: 0; background: transparent; color: inherit; font-size: .8rem; }
.ai-rich-content a,
.study-ai-answer #mpAiAnswerText a { color: var(--primary); font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.ai-rich-content hr,
.study-ai-answer #mpAiAnswerText hr { margin: 20px 0; border: 0; border-top: 1px solid #e4e7ec; }
.ai-table-wrap { width: 100%; margin: 15px 0 18px; overflow-x: auto; border: 1px solid #e4e7ec; border-radius: 10px; background: #fff; }
.ai-table-wrap table { width: 100%; border-collapse: collapse; min-width: 440px; font-size: .8rem; }
.ai-table-wrap th,
.ai-table-wrap td { padding: 9px 11px; border-bottom: 1px solid #eaecf0; text-align: left; vertical-align: top; }
.ai-table-wrap th { background: #f8fafc; color: #344054; font-weight: 750; }
.ai-table-wrap tr:last-child td { border-bottom: 0; }

/* El parser ya controla los saltos de linea; evitamos mostrar Markdown crudo. */
.study-ai-answer #mpAiAnswerText { margin-top: 9px; white-space: normal; }


/* =========================================================
   Lecciones editoriales enriquecidas (Módulo 1)
   ========================================================= */
.article-lead {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #475467;
}
.pull-quote {
  margin: 26px 0;
  padding: 18px 20px;
  border-left: 4px solid #2563eb;
  background: #f8fbff;
  border-radius: 0 14px 14px 0;
}
.pull-quote p {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.6;
  color: #0f172a;
}
.pull-quote small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: .76rem;
}
.key-callout, .warning-box, .success-box, .figure-card, .exercise-box {
  margin: 22px 0;
  border-radius: 16px;
  padding: 18px 20px;
}
.key-callout {
  background: #eef6ff;
  border: 1px solid #cfe0ff;
}
.key-callout strong,
.warning-box strong,
.success-box strong { color: #0f172a; }
.warning-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.success-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.figure-card {
  background: #fcfcfd;
  border: 1px solid var(--line);
}
.figure-card svg {
  display: block;
  width: 100%;
  height: auto;
}
.figure-card figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: .78rem;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
}
.mini-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: white;
}
.mini-card h3 {
  margin: 0 0 8px;
  font-size: .98rem;
}
.mini-card p,
.mini-card ul { margin: 0; font-size: .92rem; color: #475467; }
.mini-card ul { padding-left: 18px; }
.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.fact-pill {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
}
.fact-pill strong {
  display: block;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-bottom: 5px;
}
.fact-pill span {
  display: block;
  color: #475467;
  font-size: .83rem;
  line-height: 1.45;
}
.compact-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 18px;
  font-size: .9rem;
}
.compact-table th,
.compact-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}
.compact-table th {
  background: #f8fafc;
  text-align: left;
  color: #0f172a;
}
.compact-table td { color: #475467; }
.tip-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.tip-list li {
  position: relative;
  padding: 11px 12px 11px 42px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e9edf3;
}
.tip-list li::before {
  content: '✓';
  position: absolute;
  left: 14px;
  top: 11px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: .78rem;
}
.exercise-box {
  background: #f8fafc;
  border: 1px solid var(--line);
}
.exercise-box h3 { margin-top: 0; }
.exercise-case {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 15px;
  margin-top: 12px;
}
.exercise-case summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
}
.exercise-case p:last-child { margin-bottom: 0; }
.exercise-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.exercise-label.yes { background: #ecfdf3; color: #027a48; }
.exercise-label.maybe { background: #fff7ed; color: #b54708; }
.exercise-label.no { background: #fef3f2; color: #b42318; }
.inline-emphasis {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}
@media (max-width: 720px) {
  .cards-grid,
  .fact-strip,
  .risk-zone-grid { grid-template-columns: 1fr; }
}


/* =========================================================
   Bloques editoriales de experiencia y criterio
   ========================================================= */
.editorial-note {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid #dbe3ee;
  border-left-width: 5px;
  border-radius: 14px;
  background: #fbfcfe;
}
.editorial-note__label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.editorial-note p { margin: 0 0 9px; }
.editorial-note p:last-child { margin-bottom: 0; }
.editorial-note--practice { border-left-color: #2563eb; background: #f8fbff; }
.editorial-note--practice .editorial-note__label { color: #1d4ed8; }
.editorial-note--criterion { border-left-color: #16a34a; background: #f7fdf9; }
.editorial-note--criterion .editorial-note__label { color: #15803d; }
.editorial-note--error { border-left-color: #f59e0b; background: #fffbeb; }
.editorial-note--error .editorial-note__label { color: #a16207; }
.editorial-note--curiosity { border-left-color: #7c3aed; background: #faf7ff; }
.editorial-note--curiosity .editorial-note__label { color: #6d28d9; }
.editorial-note a { color: var(--primary); font-weight: 700; }
.term-definition {
  margin: 20px 0 24px;
  padding: 20px 22px;
  border-radius: 16px;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
}
.term-definition__term {
  display: block;
  margin-bottom: 8px;
  color: #1d4ed8;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.term-definition p { margin: 0 0 8px; }
.term-definition p:last-child { margin-bottom: 0; }


.risk-zone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 6px 0 4px;
}
.risk-zone {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  background: #fff;
}
.risk-zone__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.risk-zone__dot {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  flex: 0 0 34px;
}
.risk-zone h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}
.risk-zone p {
  margin: 0 0 8px;
  color: #475467;
  line-height: 1.55;
}
.risk-zone p:last-child { margin-bottom: 0; }
.risk-zone--green {
  background: #f3fcf6;
  border-color: #b7ebc5;
}
.risk-zone--green .risk-zone__dot { background: #22c55e; }
.risk-zone--green h3,
.risk-zone--green p strong { color: #14532d; }
.risk-zone--amber {
  background: #fff8ef;
  border-color: #f5c999;
}
.risk-zone--amber .risk-zone__dot { background: #f59e0b; }
.risk-zone--amber h3,
.risk-zone--amber p strong { color: #9a3412; }
.risk-zone--red {
  background: #fef5f5;
  border-color: #f3c1c1;
}
.risk-zone--red .risk-zone__dot { background: #ef4444; }
.risk-zone--red h3,
.risk-zone--red p strong { color: #7f1d1d; }


/* =========================================================
   Módulo 1 · segunda revisión editorial y visual
   ========================================================= */
.lesson-content h3 {
  margin: 24px 0 10px;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.35;
}
.pull-quote,
.key-callout,
.warning-box,
.success-box,
.figure-card,
.exercise-box,
.editorial-note,
.term-definition,
.mini-card,
.fact-pill,
.risk-zone,
.signal-card,
.compare-panel,
.process-step,
.timeline-item,
.two-axis-box > div {
  overflow-wrap: anywhere;
  min-width: 0;
}
.pull-quote,
.key-callout,
.warning-box,
.success-box,
.editorial-note,
.term-definition {
  line-height: 1.62;
}
.figure-card {
  padding: 20px;
  overflow: hidden;
}
.figure-card figcaption {
  padding-top: 12px;
  border-top: 1px solid #edf0f4;
  line-height: 1.5;
}
.cards-grid {
  gap: 16px;
  align-items: stretch;
}
.mini-card {
  padding: 18px;
  line-height: 1.55;
}
.mini-card p + p { margin-top: 8px; }
.fact-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.fact-pill {
  padding: 16px;
  line-height: 1.5;
}
.compact-table {
  table-layout: fixed;
}
.compact-table th,
.compact-table td {
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.editorial-note {
  padding: 19px 21px;
}
.term-definition {
  padding: 22px 24px;
}

.timeline-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.timeline-item {
  position: relative;
  padding: 16px 17px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}
.timeline-item--accent {
  grid-column: 1 / -1;
  background: #f8fbff;
  border-color: #bfdbfe;
}
.timeline-year {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .04em;
}
.timeline-item strong { display: block; color: #0f172a; }
.timeline-item p { margin: 6px 0 0; color: #475467; font-size: .88rem; line-height: 1.5; }

.concept-ladder {
  width: min(620px, 100%);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 7px;
}
.concept-step {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}
.concept-step strong { display: block; color: #0f172a; font-size: 1rem; }
.concept-step span { display: block; margin-top: 3px; color: #667085; font-size: .8rem; }
.concept-step--1 { width: 100%; background: #eff6ff; border-color: #bfdbfe; }
.concept-step--2 { width: 88%; background: #ecfdf3; border-color: #bbf7d0; }
.concept-step--3 { width: 76%; background: #fff7ed; border-color: #fed7aa; }
.concept-step--4 { width: 64%; background: #faf5ff; border-color: #ddd6fe; }
.concept-step--5 { width: 52%; background: #f8fafc; border-color: #d0d5dd; }
.concept-arrow { color: #2563eb; font-size: 1.1rem; line-height: 1; }

.compare-visual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.compare-panel {
  padding: 18px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: #fff;
}
.compare-panel--accent { background: #f8fbff; border-color: #bfdbfe; }
.visual-kicker {
  display: block;
  margin-bottom: 14px;
  color: #475467;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.compare-panel > p {
  margin: 14px 0 0;
  color: #475467;
  font-size: .84rem;
  line-height: 1.5;
}
.visual-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.visual-node {
  flex: 1 1 0;
  padding: 10px 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  text-align: center;
  font-size: .8rem;
  font-weight: 750;
}
.visual-node--input { background: #eff6ff; border-color: #bfdbfe; }
.visual-node--model { background: #fff7ed; border-color: #fed7aa; }
.visual-node--output { background: #ecfdf3; border-color: #bbf7d0; }
.visual-node--tool { background: #faf5ff; border-color: #ddd6fe; }
.visual-arrow { flex: 0 0 auto; color: #2563eb; font-weight: 850; }
.tool-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.tool-chip-row span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbe3ee;
  color: #475467;
  font-size: .7rem;
  font-weight: 750;
}

.process-flow {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr);
  gap: 8px;
  align-items: stretch;
}
.process-flow--three {
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr);
}
.process-step {
  padding: 14px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}
.process-step > span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .7rem;
  font-weight: 850;
}
.process-step strong { display: block; color: #0f172a; font-size: .88rem; }
.process-step small { display: block; margin-top: 4px; color: #667085; font-size: .72rem; line-height: 1.4; }
.process-arrow { display: grid; place-items: center; color: #2563eb; font-weight: 850; }

.context-diagram {
  display: grid;
  grid-template-columns: minmax(170px,1.25fr) auto minmax(130px,.85fr) auto minmax(120px,.75fr) auto minmax(120px,.75fr);
  gap: 10px;
  align-items: center;
}
.context-sources {
  display: grid;
  gap: 7px;
}
.context-sources span {
  padding: 8px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  color: #475467;
  font-size: .76rem;
  text-align: center;
}
.context-core,
.context-model,
.context-output {
  display: grid;
  align-content: center;
  min-height: 128px;
  padding: 14px;
  border-radius: 15px;
  border: 1px solid #dbe3ee;
  text-align: center;
}
.context-core { background: #f8fafc; }
.context-model { background: #fff7ed; border-color: #fed7aa; }
.context-output { background: #ecfdf3; border-color: #bbf7d0; }
.context-core strong,
.context-model strong,
.context-output strong { color: #0f172a; }
.context-core small,
.context-model small,
.context-output small { margin-top: 5px; color: #667085; line-height: 1.4; }
.context-arrow { color: #2563eb; font-weight: 850; }

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.signal-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.signal-card strong { display: block; margin-bottom: 5px; color: #0f172a; }
.signal-card span { display: block; color: #475467; font-size: .84rem; line-height: 1.5; }
.signal-card--red { background: #fef5f5; border-color: #fecaca; }
.signal-card--amber { background: #fff8ef; border-color: #fed7aa; }
.signal-card--yellow { background: #fffdf0; border-color: #fde68a; }
.signal-card--blue { background: #f5f9ff; border-color: #bfdbfe; }

.two-axis-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.two-axis-box > div {
  padding: 15px 16px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #f8fafc;
}
.two-axis-box strong { display: block; color: #0f172a; }
.two-axis-box span { display: block; margin-top: 4px; color: #667085; font-size: .8rem; line-height: 1.45; }

/* Revisión del semáforo: el texto siempre queda dentro de su tarjeta. */
.risk-zone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.risk-zone { padding: 17px; }
.risk-zone__head { align-items: flex-start; }
.risk-zone h3 { font-size: 1.1rem; }
.risk-zone p { font-size: .82rem; }

@media (max-width: 860px) {
  .process-flow,
  .process-flow--three {
    grid-template-columns: 1fr;
  }
  .process-arrow { transform: rotate(90deg); min-height: 20px; }
  .context-diagram { grid-template-columns: 1fr; }
  .context-arrow { text-align: center; transform: rotate(90deg); }
  .context-core,
  .context-model,
  .context-output { min-height: auto; }
  .risk-zone-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .timeline-grid,
  .fact-strip,
  .compare-visual,
  .signal-grid,
  .two-axis-box { grid-template-columns: 1fr; }
  .timeline-item--accent { grid-column: auto; }
  .concept-step--1,
  .concept-step--2,
  .concept-step--3,
  .concept-step--4,
  .concept-step--5 { width: 100%; }
  .figure-card { padding: 15px; }
  .compact-table { font-size: .8rem; }
  .compact-table th,
  .compact-table td { padding: 8px; }
  .visual-flow--compact { flex-wrap: wrap; }
  .visual-node { min-width: 72px; }
}

/* =========================================================
   Onboarding v2 y personalización por perfil
   ========================================================= */
.diagnostic-intro-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 26px;
}
.diagnostic-intro-card > div {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.diagnostic-intro-card strong,
.diagnostic-intro-card span { display: block; }
.diagnostic-intro-card strong { color: #101828; font-size: .9rem; }
.diagnostic-intro-card span { margin-top: 4px; color: var(--muted); font-size: .76rem; line-height: 1.45; }

.diagnostic-wizard {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcfe;
  overflow: hidden;
}
.diagnostic-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.diagnostic-step-dot {
  position: relative;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 13px 8px 12px;
  color: var(--muted);
  cursor: pointer;
}
.diagnostic-step-dot:last-child { border-right: 0; }
.diagnostic-step-dot > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0 auto 6px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: .73rem;
  font-weight: 800;
}
.diagnostic-step-dot small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .66rem;
  font-weight: 700;
}
.diagnostic-step-dot.is-active { color: #1d4ed8; background: #f8fbff; }
.diagnostic-step-dot.is-active > span { background: #2563eb; color: #fff; }
.diagnostic-step-dot.is-complete > span { background: #dcfce7; color: #15803d; }

.diagnostic-step {
  padding: clamp(20px, 4vw, 34px);
}
.diagnostic-step[hidden] { display: none; }
.diagnostic-step-head { margin-bottom: 22px; }
.diagnostic-step-head > span {
  display: block;
  color: #2563eb;
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .1em;
}
.diagnostic-step-head h2 { margin: 5px 0 6px; font-size: 1.42rem; }
.diagnostic-step-head p { margin: 0; color: var(--muted); font-size: .87rem; }
.diagnostic-fields {
  display: grid;
  gap: 15px;
}
.diagnostic-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.diagnostic-step label,
.diagnostic-fieldset legend {
  color: #344054;
  font-size: .84rem;
  font-weight: 750;
}
.diagnostic-step label { display: grid; gap: 7px; margin-top: 15px; }
.diagnostic-step label:first-of-type { margin-top: 0; }
.diagnostic-step label small,
.diagnostic-fieldset legend small { color: var(--muted); font-weight: 500; }
.diagnostic-step input[type="text"],
.diagnostic-step select,
.diagnostic-step textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.diagnostic-step textarea { resize: vertical; line-height: 1.5; }
.diagnostic-step input[type="text"]:focus,
.diagnostic-step select:focus,
.diagnostic-step textarea:focus {
  outline: 3px solid #dbeafe;
  border-color: #60a5fa;
}
.diagnostic-fieldset {
  min-width: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}
.diagnostic-fieldset legend { margin-bottom: 10px; }
.diagnostic-fieldset.is-muted { opacity: .48; pointer-events: none; }
.choice-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-card {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 9px !important;
  margin: 0 !important;
  min-width: 0;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.choice-card:hover { border-color: #93c5fd; background: #f8fbff; }
.choice-card:has(input:checked) { border-color: #60a5fa; background: #eff6ff; box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.choice-card input { width: auto !important; margin: 3px 0 0 !important; flex: 0 0 auto; }
.choice-card span { min-width: 0; overflow-wrap: anywhere; font-size: .8rem; line-height: 1.4; }
.diagnostic-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(20px, 4vw, 34px);
  border-top: 1px solid var(--line);
  background: #fff;
}
.diagnostic-actions-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.diagnostic-actions-right > span { color: var(--muted); font-size: .74rem; }
.diagnostic-complete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 17px 18px;
  border: 1px solid #bbf7d0;
  border-radius: 15px;
  background: #f0fdf4;
}
.diagnostic-complete > div { min-width: 0; }
.diagnostic-complete strong,
.diagnostic-complete span { display: block; }
.diagnostic-complete strong { color: #14532d; }
.diagnostic-complete span { margin-top: 4px; color: #3f6c4b; font-size: .79rem; }

.mp-personalized-block {
  margin: 28px 0;
  padding: 19px 20px 17px;
  border: 1px solid #d8e3ff;
  border-left: 5px solid #4f46e5;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8faff 0%, #ffffff 72%);
  box-shadow: 0 8px 20px rgba(30,64,175,.045);
  overflow: hidden;
}
.mp-personalized-block--risk { border-color: #f5d7a3; border-left-color: #f59e0b; background: linear-gradient(135deg,#fffaf0,#fff 72%); }
.mp-personalized-block--action { border-color: #bfe5ca; border-left-color: #16a34a; background: linear-gradient(135deg,#f5fcf7,#fff 72%); }
.mp-personalized-block--example { border-color: #ddd6fe; border-left-color: #7c3aed; background: linear-gradient(135deg,#faf8ff,#fff 72%); }
.mp-personalized-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}
.mp-personalized-kicker {
  display: block;
  margin-bottom: 4px;
  color: #4f46e5;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .1em;
}
.mp-personalized-block--risk .mp-personalized-kicker { color: #a16207; }
.mp-personalized-block--action .mp-personalized-kicker { color: #15803d; }
.mp-personalized-block--example .mp-personalized-kicker { color: #6d28d9; }
.mp-personalized-head h3 { margin: 0; color: #101828; font-size: 1.08rem; }
.mp-personalized-refresh {
  flex: 0 0 auto;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 6px 9px;
  background: #fff;
  color: #667085;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
}
.mp-personalized-refresh:hover { color: #1d4ed8; border-color: #93c5fd; }
.mp-personalized-loading {
  padding: 13px 14px;
  border-radius: 10px;
  background: rgba(238,242,255,.75);
  color: #475467;
  font-size: .82rem;
}
.mp-personalized-loading::before { content: '✦'; margin-right: 7px; color: #4f46e5; }
.mp-personalized-body { margin-top: 8px; }
.mp-personalized-error { margin: 8px 0 0 !important; color: #b42318; font-size: .78rem; }
.mp-personalized-error.is-onboarding-prompt { color: #475467; font-size: .86rem; line-height: 1.65; }
.mp-personalized-error.is-onboarding-prompt a { display: inline-block; margin-left: 4px; color: #3730a3; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.mp-personalized-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(208,213,221,.65);
  color: #7c8594;
  font-size: .67rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .diagnostic-intro-card,
  .diagnostic-fields.two,
  .choice-grid--compact { grid-template-columns: 1fr; }
  .diagnostic-stepper { display: flex; overflow-x: auto; }
  .diagnostic-step-dot { flex: 0 0 94px; }
  .diagnostic-step-dot small { white-space: normal; line-height: 1.2; }
  .diagnostic-actions { align-items: stretch; flex-direction: column; }
  .diagnostic-actions-right { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .diagnostic-actions-right > span { flex: 1 1 100%; }
  .diagnostic-actions .btn { flex: 1; }
  .diagnostic-complete { align-items: stretch; flex-direction: column; }
  .mp-personalized-head { align-items: flex-start; }
}

.ai-quota-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 9px; border: 1px solid #fde68a; border-radius: 999px; background: #fffbeb; color: #92400e; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.ai-quota-pill strong { font-size: .78rem; color: #78350f; }
.ai-quota-symbol { font-size: .78rem; line-height: 1; }
.ai-quota-pill.is-low { border-color: #fdba74; background: #fff7ed; color: #9a3412; }
.ai-quota-pill.is-empty { border-color: #fecaca; background: #fef2f2; color: #b42318; }
.ai-quota-pill.is-empty strong { color: #991b1b; }

.learning-profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid #d8e3ff;
  border-radius: 17px;
  background: linear-gradient(135deg,#f8faff,#fff);
  box-shadow: 0 7px 20px rgba(37,99,235,.035);
}
.learning-profile-main { min-width: 0; }
.learning-profile-main h2 { margin: 3px 0 7px; font-size: 1.05rem; }
.learning-profile-main p { margin: 0; color: #475467; font-size: .82rem; overflow-wrap: anywhere; }
.learning-profile-meta { display: grid; justify-items: end; gap: 4px; text-align: right; }
.learning-profile-meta > span { color: #4f46e5; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.learning-profile-meta strong { font-size: .82rem; }
.learning-profile-meta a { color: #2563eb; font-size: .74rem; font-weight: 700; text-decoration: none; }
@media (max-width: 720px) {
  .learning-profile-card { grid-template-columns: 1fr; }
  .learning-profile-meta { justify-items: start; text-align: left; }
}
.diagnostic-step-dot:disabled { cursor: default; opacity: .7; }

/* =========================================================
   Módulo 2 · Mapa de herramientas de IA
   ========================================================= */
.tool-landscape {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.tool-mode-card {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow-wrap: anywhere;
}
.tool-mode-card h3 {
  margin: 0 0 7px;
  color: #101828;
  font-size: 1rem;
  line-height: 1.3;
}
.tool-mode-card p {
  margin: 0;
  color: #475467;
  font-size: .87rem;
  line-height: 1.55;
}
.tool-mode-card .tool-mode-card__tag {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.process-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 22px 0;
  counter-reset: flow;
}
.process-flow--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.process-step {
  position: relative;
  min-width: 0;
  padding: 16px 15px;
  border: 1px solid #dbe3ee;
  border-radius: 15px;
  background: #fbfcfe;
  text-align: center;
  overflow-wrap: anywhere;
}
.process-step::before {
  counter-increment: flow;
  content: counter(flow);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
}
.process-step:not(:last-child)::after {
  content: '→';
  position: absolute;
  top: 50%;
  right: -18px;
  transform: translateY(-50%);
  color: #98a2b3;
  font-size: 1.25rem;
  font-weight: 700;
}
.process-step strong {
  display: block;
  color: #101828;
  font-size: .86rem;
  line-height: 1.35;
}
.process-step span {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: .76rem;
  line-height: 1.4;
}
.agent-loop-card {
  margin: 22px 0;
  padding: 20px;
  border: 1px solid #ddd6fe;
  border-radius: 18px;
  background: linear-gradient(135deg,#faf8ff,#fff);
}
.agent-loop-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.agent-loop-node {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid #e4e7ec;
  border-radius: 13px;
  background: white;
  text-align: center;
  overflow-wrap: anywhere;
}
.agent-loop-node strong {
  display: block;
  color: #101828;
  font-size: .82rem;
}
.agent-loop-node span {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: .7rem;
  line-height: 1.35;
}
.agent-loop-arrow {
  display: none;
}
.tool-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 20px 0;
}
.tool-decision-card {
  min-width: 0;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow-wrap: anywhere;
}
.tool-decision-card strong {
  display: block;
  margin-bottom: 6px;
  color: #101828;
}
.tool-decision-card span {
  color: #475467;
  font-size: .84rem;
  line-height: 1.5;
}
.capability-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.capability-stack > div {
  min-width: 0;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  text-align: center;
  overflow-wrap: anywhere;
}
.capability-stack strong {
  display: block;
  color: #101828;
  font-size: .8rem;
}
.capability-stack span {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: .7rem;
  line-height: 1.35;
}
.exercise-choice-list {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}
.exercise-choice-list .exercise-case {
  margin-top: 0;
}
.mode-fit-table td:first-child,
.mode-fit-table th:first-child { width: 30%; }
.mode-fit-table td:nth-child(2),
.mode-fit-table th:nth-child(2) { width: 28%; }

@media (max-width: 820px) {
  .tool-landscape { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-flow { grid-template-columns: 1fr 1fr; gap: 12px; }
  .process-step:not(:last-child)::after { display: none; }
  .agent-loop-grid { grid-template-columns: 1fr 1fr; }
  .capability-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tool-landscape,
  .tool-decision-grid,
  .process-flow,
  .agent-loop-grid,
  .capability-stack { grid-template-columns: 1fr; }
}

/* =========================================================
   Módulo 3 · costes, modelos y ROI
   ========================================================= */
.cost-context-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 24px;
}
.cost-context-stack > div {
  padding: 15px 13px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}
.cost-context-stack strong,
.cost-context-stack span { display: block; }
.cost-context-stack strong { color: #0f172a; font-size: .88rem; line-height: 1.35; }
.cost-context-stack span { margin-top: 6px; color: #667085; font-size: .76rem; line-height: 1.45; }

.cost-equation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}
.cost-equation > div {
  padding: 16px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #f8fafc;
}
.cost-equation span,
.cost-equation strong { display: block; }
.cost-equation span { color: #667085; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.cost-equation strong { margin-top: 6px; color: #101828; font-size: .92rem; line-height: 1.4; }
.cost-equation__total { background: #ecfdf3 !important; border-color: #bbf7d0 !important; }

.cost-layer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.cost-layer-grid > div {
  position: relative;
  padding: 17px 17px 17px 54px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}
.cost-layer-grid > div > span {
  position: absolute;
  left: 16px;
  top: 17px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .68rem;
  font-weight: 850;
}
.cost-layer-grid strong { display: block; color: #0f172a; }
.cost-layer-grid p { margin: 5px 0 0; color: #667085; font-size: .82rem; line-height: 1.48; }

.model-ladder {
  display: grid;
  gap: 9px;
  margin: 18px 0 24px;
}
.model-ladder__step {
  display: grid;
  grid-template-columns: 34px minmax(140px, .8fr) minmax(0, 2fr);
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}
.model-ladder__step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .72rem;
  font-weight: 850;
}
.model-ladder__step strong { color: #0f172a; }
.model-ladder__step small { color: #667085; line-height: 1.45; }

.routing-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 24px;
}
.routing-flow > div {
  padding: 15px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}
.routing-flow span {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .7rem;
  font-weight: 850;
}
.routing-flow strong,
.routing-flow small { display: block; }
.routing-flow strong { color: #0f172a; font-size: .88rem; }
.routing-flow small { margin-top: 5px; color: #667085; font-size: .76rem; line-height: 1.45; }

.cost-formula-card {
  margin: 18px 0 22px;
  padding: 22px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #f8fbff;
}
.cost-formula-card strong { display: block; color: #0f172a; font-size: 1.05rem; line-height: 1.5; }

.roi-calculator {
  margin: 22px 0 28px;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.roi-calculator__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background: #f8fafc;
  border-bottom: 1px solid #e4e7ec;
}
.roi-calculator__head h2 { margin: 2px 0 6px; }
.roi-calculator__head p { margin: 0; max-width: 650px; color: #667085; font-size: .82rem; line-height: 1.5; }
.calc-section { padding: 20px 22px; border-bottom: 1px solid #eef1f4; }
.calc-section h3 { margin: 0 0 14px; }
.calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.calc-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc-field { display: grid; gap: 6px; min-width: 0; }
.calc-field > span { color: #344054; font-size: .76rem; font-weight: 800; }
.calc-field input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: #101828;
  font: inherit;
}
.calc-field input:focus { outline: 3px solid #dbeafe; border-color: #60a5fa; }
.calc-field small { color: #667085; font-size: .7rem; line-height: 1.35; }
.calc-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 22px;
  background: #f8fafc;
}
.calc-metric {
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #fff;
  min-width: 0;
}
.calc-metric > span,
.calc-metric > strong,
.calc-metric > small { display: block; }
.calc-metric > span { color: #667085; font-size: .7rem; font-weight: 750; }
.calc-metric > strong { margin-top: 5px; color: #101828; font-size: 1.08rem; overflow-wrap: anywhere; }
.calc-metric > small { margin-top: 4px; color: #667085; font-size: .7rem; }
.calc-metric--hero { grid-column: span 2; border-color: #bbf7d0; background: #ecfdf3; }
.calc-metric--hero.is-negative { border-color: #fecaca; background: #fef2f2; }
.calc-metric--hero.is-negative > strong { color: #b42318; }
.calc-metric--hero.is-positive > strong { color: #067647; }

@media (max-width: 900px) {
  .cost-context-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routing-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cost-context-stack,
  .cost-equation,
  .cost-layer-grid,
  .routing-flow,
  .calc-grid,
  .calc-grid--three,
  .calc-results { grid-template-columns: 1fr; }
  .model-ladder__step { grid-template-columns: 32px 1fr; }
  .model-ladder__step small { grid-column: 2; }
  .roi-calculator__head { flex-direction: column; }
  .calc-metric--hero { grid-column: auto; }
}

/* =========================================================
   M03 · Calculadora simplificada de coste y retorno (v2.3.14)
   ========================================================= */
.roi-calculator--simple .calc-simple-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
}
.calc-simple-intro__number {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 1.1rem;
  font-weight: 850;
}
.calc-simple-intro strong { display: block; color: #78350f; }
.calc-simple-intro p { margin: 3px 0 0; color: #92400e; font-size: .78rem; line-height: 1.45; }
.roi-calculator--simple .calc-section--simple { padding-top: 18px; padding-bottom: 18px; }
.roi-calculator--simple .calc-section--simple h3 { font-size: .96rem; }
.calc-grid--simple { grid-template-columns: minmax(0, 360px); }
.calc-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc-field--featured input { font-size: 1.05rem; font-weight: 750; }
.calc-input-unit {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.calc-input-unit input {
  border-radius: 10px 0 0 10px;
}
.calc-input-unit > span {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid #d0d5dd;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: #f8fafc;
  color: #667085;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.calc-field.is-updated { animation: mpCalcUpdated .9s ease; }
@keyframes mpCalcUpdated {
  0%, 100% { filter: none; }
  45% { filter: drop-shadow(0 0 7px rgba(37,99,235,.28)); }
}
.calc-results--simple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.calc-results--simple .calc-metric--hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 18px;
}
.calc-results--simple .calc-metric--hero > span,
.calc-results--simple .calc-metric--hero > small { grid-column: 1; }
.calc-results--simple .calc-metric--hero > strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
  font-size: 1.45rem;
}
.calc-reading {
  margin: 0 22px 22px;
  padding: 15px 16px;
  border-left: 4px solid #60a5fa;
  border-radius: 0 12px 12px 0;
  background: #eff6ff;
}
.calc-reading strong { display: block; color: #1e3a8a; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.calc-reading p { margin: 5px 0 0; color: #344054; font-size: .82rem; line-height: 1.52; }
.calc-advanced {
  margin: 0 22px 22px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.calc-advanced summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 17px;
  cursor: pointer;
  background: #f8fafc;
  color: #344054;
  font-weight: 800;
}
.calc-advanced summary small { color: #667085; font-size: .68rem; font-weight: 650; }
.calc-advanced__body { padding: 17px; border-top: 1px solid #e4e7ec; }
.calc-advanced__body > p { margin: 0 0 15px; color: #667085; font-size: .78rem; line-height: 1.5; }
.calc-api-estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
}
.calc-api-estimate span,
.calc-api-estimate strong { display: block; }
.calc-api-estimate span { color: #667085; font-size: .7rem; font-weight: 750; }
.calc-api-estimate strong { margin-top: 3px; color: #101828; font-size: 1rem; }
.calc-disclaimer { display: block; margin-top: 12px; color: #667085; font-size: .68rem; line-height: 1.45; }

@media (max-width: 900px) {
  .calc-results--simple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-results--simple .calc-metric--hero { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .calc-grid--two,
  .calc-results--simple { grid-template-columns: 1fr; }
  .calc-results--simple .calc-metric--hero {
    grid-column: auto;
    display: block;
  }
  .calc-results--simple .calc-metric--hero > strong { margin-top: 5px; font-size: 1.2rem; }
  .calc-api-estimate { align-items: stretch; flex-direction: column; }
  .calc-api-estimate .btn { width: 100%; }
  .roi-calculator--simple .calc-simple-intro { align-items: flex-start; }
}


/* =========================================================
   M04 · Prompting profesional y laboratorio (v2.3.16)
   ========================================================= */
.prompt-foundation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 25px;
}
.prompt-foundation > div {
  padding: 17px;
  border: 1px solid #dbe3ee;
  border-radius: 15px;
  background: #fff;
  min-width: 0;
}
.prompt-foundation > div > span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-bottom: 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .7rem;
  font-weight: 850;
}
.prompt-foundation strong,
.prompt-foundation small { display: block; }
.prompt-foundation strong { color: #101828; font-size: .94rem; }
.prompt-foundation small { margin-top: 5px; color: #667085; font-size: .77rem; line-height: 1.45; }

.prompt-three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.prompt-three-grid > div {
  padding: 18px;
  border: 1px solid #dbe3ee;
  border-radius: 15px;
  background: #fff;
  min-width: 0;
}
.prompt-three-grid > div > span {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .65rem;
  font-weight: 850;
  letter-spacing: .05em;
}
.prompt-three-grid strong { display: block; color: #101828; }
.prompt-three-grid p { margin: 7px 0 0; color: #667085; font-size: .8rem; line-height: 1.5; }

.prompt-format-row,
.prompt-reference-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 23px;
}
.prompt-format-row span,
.prompt-reference-tags span {
  padding: 7px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: .72rem;
  font-weight: 750;
}

.prompt-code-card {
  margin: 18px 0 24px;
  border: 1px solid #dbe3ee;
  border-radius: 15px;
  background: #111827;
  overflow: hidden;
}
.prompt-code-card pre {
  margin: 0;
  padding: 19px;
  overflow-x: auto;
  white-space: pre-wrap;
  color: #f3f4f6;
  font: 500 .8rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prompt-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 18px 0 24px;
}
.prompt-template > div {
  display: grid;
  grid-template-columns: minmax(105px, .55fr) minmax(0, 1.45fr);
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
}
.prompt-template strong { color: #101828; }
.prompt-template span { color: #667085; font-size: .79rem; line-height: 1.45; }

.prompt-lab-rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 24px;
}
.prompt-lab-rules > div {
  padding: 15px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}
.prompt-lab-rules > div > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: .74rem;
  font-weight: 900;
}
.prompt-lab-rules strong,
.prompt-lab-rules small { display: block; }
.prompt-lab-rules strong { color: #101828; font-size: .85rem; }
.prompt-lab-rules small { margin-top: 5px; color: #667085; font-size: .72rem; line-height: 1.45; }

.prompt-lab-case {
  margin: 18px 0 25px;
  padding: 19px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #f8fbff;
}
.prompt-lab-case__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.prompt-lab-case__head strong { display: block; color: #101828; font-size: 1rem; }
.prompt-lab-case__badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: .66rem;
  font-weight: 800;
}
.prompt-lab-case > p { margin: 10px 0 14px; color: #475467; font-size: .82rem; line-height: 1.5; }
.prompt-lab-case pre {
  margin: 0;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  color: #344054;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 500 .78rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prompt-lab {
  margin: 24px 0 30px;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.prompt-lab-stage {
  padding: 22px;
  border-bottom: 1px solid #e4e7ec;
}
.prompt-lab-stage:last-child { border-bottom: 0; }
.prompt-lab-stage[hidden] { display: none; }
.prompt-lab-stage__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.prompt-lab-stage__head h2 { margin: 0 0 4px; font-size: 1.08rem; }
.prompt-lab-stage__head p { margin: 0; color: #667085; font-size: .79rem; line-height: 1.48; }
.prompt-lab-step {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .78rem;
  font-weight: 850;
}
.prompt-lab-field { display: grid; gap: 7px; }
.prompt-lab-field > span { color: #344054; font-size: .78rem; font-weight: 800; }
.prompt-lab-field textarea {
  width: 100%;
  min-height: 145px;
  padding: 13px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fff;
  color: #101828;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}
.prompt-lab-field textarea:focus { outline: 3px solid #dbeafe; border-color: #60a5fa; }
.prompt-lab-field small { justify-self: end; color: #667085; font-size: .7rem; }
.prompt-lab-field small.is-near-limit { color: #b54708; font-weight: 800; }
.prompt-lab-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
}
.prompt-lab-status { color: #667085; font-size: .74rem; line-height: 1.4; }

.prompt-lab-output {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #f8fafc;
}
.prompt-lab-output--reference {
  border-color: #bbf7d0;
  background: #f6fef9;
}
.prompt-lab-output__label {
  margin-bottom: 12px;
  color: #475467;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .05em;
}
.prompt-lab-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.prompt-lab-model {
  margin: 12px 0 0;
  color: #667085;
  font-size: .7rem;
  line-height: 1.45;
}

.prompt-reference-card {
  margin-bottom: 16px;
  padding: 17px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #f8fbff;
}
.prompt-reference-card__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #1d2939;
}
.prompt-reference-card__head span { color: #667085; font-size: .7rem; font-weight: 750; white-space: nowrap; }
.prompt-reference-card > p { margin: 10px 0 0; color: #344054; font-size: .83rem; line-height: 1.58; }
.prompt-reference-card .prompt-reference-tags { margin-bottom: 0; }

.prompt-lab-checklist {
  margin-top: 18px;
  padding: 17px;
  border-radius: 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.prompt-lab-checklist h3 { margin: 0 0 4px; color: #78350f; font-size: .94rem; }
.prompt-lab-checklist > p { margin: 0 0 12px; color: #92400e; font-size: .76rem; }
.prompt-lab-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  color: #594a2a;
  font-size: .78rem;
  line-height: 1.45;
}
.prompt-lab-checklist input { margin-top: 2px; }

@media (max-width: 900px) {
  .prompt-lab-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .prompt-foundation,
  .prompt-three-grid,
  .prompt-template,
  .prompt-lab-rules,
  .prompt-lab-compare { grid-template-columns: 1fr; }
  .prompt-template > div { grid-template-columns: minmax(95px, .7fr) minmax(0, 1.3fr); }
  .prompt-lab-case__head,
  .prompt-reference-card__head,
  .prompt-lab-actions { align-items: stretch; flex-direction: column; }
  .prompt-lab-case__badge { align-self: flex-start; }
  .prompt-lab-actions .btn { width: 100%; }
  .prompt-lab-stage { padding: 18px 15px; }
}

/* Perfil, invitaciones y acceso empresarial */
.profile-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.profile-edit-card { max-width:760px; margin-inline:auto; }
.invite-card { width:min(620px,100%); }
.invite-consent { align-items:flex-start; }
.invite-consent input { width:auto !important; min-width:17px; margin-top:2px; }
.invite-consent a { color:var(--primary); }
.form-stack label small { font-weight:500; }
@media (max-width:720px) { .profile-form-grid { grid-template-columns:1fr; } }
.lesson-business-cta { margin:14px 0 18px; padding:12px 15px; border:1px solid var(--line); border-radius:12px; background:#fff; display:flex; align-items:center; justify-content:space-between; gap:14px; color:var(--muted); font-size:.78rem; }
.lesson-business-cta a { color:var(--primary); font-weight:800; text-decoration:none; white-space:nowrap; }
@media (max-width:620px) { .lesson-business-cta { align-items:flex-start; flex-direction:column; } }

/* Transparencia y metodología editorial */
.lesson-editorial-disclaimer {
  margin: 12px 0 18px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.5;
}
.lesson-editorial-disclaimer strong { color: var(--text); }
.lesson-editorial-disclaimer a { color: var(--primary); font-weight: 750; text-decoration: none; }
.methodology-page { max-width: 1040px; }
.methodology-hero { margin-bottom: 22px; }
.methodology-hero h1 { margin: 4px 0 10px; }
.methodology-hero > p:last-child { max-width: 820px; color: var(--muted); line-height: 1.65; }
.methodology-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.methodology-card, .methodology-principles {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.methodology-card--wide { grid-column: 1 / -1; }
.methodology-card h2, .methodology-principles h2 { margin: 10px 0 10px; font-size: 1.08rem; }
.methodology-card p { margin: 8px 0 0; color: #475467; line-height: 1.65; }
.methodology-principles { margin-top: 16px; }
.methodology-principles .tip-list { margin-bottom: 0; }
.methodology-note { margin-top: 16px; padding: 16px 18px; border: 1px solid #fde68a; border-radius: 14px; background: #fffbeb; color: #664d03; line-height: 1.58; }
.methodology-reviewed { margin: 16px 0 0; color: var(--muted); font-size: .76rem; }
@media (max-width: 760px) { .methodology-grid { grid-template-columns: 1fr; } .methodology-card--wide { grid-column: auto; } }

/* Editorial source citations inside lessons */
.lesson-source{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.4rem .65rem;
  margin:.75rem 0 0;
  padding-top:.7rem;
  border-top:1px solid var(--border,#e5e7eb);
  font-size:.82rem;
  line-height:1.4;
  color:#667085;
}
.lesson-source__label{
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  font-size:.7rem;
  color:#475467;
}
.lesson-source__meta{font-weight:600;color:#475467}
.lesson-source a{font-weight:700;text-decoration:none}
.lesson-source a:hover{text-decoration:underline}
@media (max-width:640px){
  .lesson-source{align-items:flex-start;flex-direction:column;gap:.25rem}
}

/* Ventana temporal de acceso al curso */
.access-window-card {
  margin: 16px 0 24px;
  padding: 16px 20px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #eff6ff;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.access-window-card strong { color: #172554; }
.access-window-card p { margin: 3px 0 0; color: #334155; }
.access-window-meta { flex: 0 0 auto; text-align: right; }
.access-window-meta strong { display: block; font-size: 1.15rem; }
.access-window-meta span { display: block; margin-top: 2px; color: #64748b; font-size: .78rem; }
.module-time { display: inline-block; margin-top: 5px; color: #64748b; font-size: .78rem; font-weight: 700; }
.access-ended-card { max-width: 760px; margin: 50px auto; padding: 34px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.access-ended-card h1 { margin: 8px 0 14px; font-size: clamp(1.8rem,4vw,2.7rem); line-height: 1.08; }
.access-ended-card p { color: #475569; line-height: 1.65; }
.access-ended-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
@media (max-width: 700px) {
  .access-window-card { align-items: flex-start; flex-direction: column; }
  .access-window-meta { text-align: left; }
}

/* Persistencia de respuestas y ejercicios */
.lesson-form-save-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 9px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #526071;
  font-size: .76rem;
  line-height: 1.35;
}
.lesson-form-save-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #16a34a;
}
.lesson-form-save-status[data-status="dirty"] .lesson-form-save-dot,
.lesson-form-save-status[data-status="saving"] .lesson-form-save-dot { background: #d97706; }
.lesson-form-save-status[data-status="offline"] {
  border-color: #f2c9c9;
  background: #fff8f8;
  color: #8a3434;
}
.lesson-form-save-status[data-status="offline"] .lesson-form-save-dot { background: #dc2626; }
.notebook-item-type {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.notebook-answer-label {
  display: block;
  color: #344054;
  font-size: .78rem;
  font-weight: 760;
  margin-bottom: 4px;
}

/* Cuaderno: respuestas generadas expresamente por el alumno con IA */
.notebook-ai-item { background: #fcfcfd; }
.notebook-item-type-ai { background: #eef4ff; color: #1849a9; }
.notebook-ai-context,
.notebook-ai-request,
.notebook-ai-response { margin-top: 10px; }
.notebook-ai-context > span,
.notebook-ai-request > span,
.notebook-ai-response > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.notebook-ai-context blockquote {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--line);
  background: #fff;
  border-radius: 0 8px 8px 0;
}
.notebook-ai-request p,
.notebook-ai-response p { margin: 0; white-space: normal; }
.notebook-ai-response details { margin-top: 9px; }
.notebook-ai-response summary {
  cursor: pointer;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 750;
}
.notebook-ai-full {
  margin-top: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #344054;
  font-size: .82rem;
  line-height: 1.55;
}

/* =========================================================
   Navegación compacta de lecciones · v2.5
   ========================================================= */
.lesson-header { overflow: visible; }
.lesson-header-row {
  position: relative;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(145px, auto) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
}
.back-link {
  color: var(--text);
  white-space: nowrap;
}
.back-link:hover { color: var(--primary); }
.lesson-module {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7b8495;
  font-size: .78rem;
  text-align: center;
}
.lesson-header-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}
.lesson-tools-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  width: auto;
}
.lesson-tool-link,
.lesson-profile-summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #344054;
  font: inherit;
  font-size: .78rem;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.lesson-tool-link:hover,
.lesson-profile-summary:hover,
.lesson-menu-dropdown[open] > summary {
  background: #f2f4f7;
  color: var(--text);
}
.lesson-nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lesson-more-menu .lesson-nav-icon circle { fill: currentColor; stroke: none; }
.lesson-menu-chevron {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .16s ease;
}
.lesson-menu-dropdown[open] .lesson-menu-chevron { transform: rotate(180deg); }
.lesson-menu-dropdown {
  position: relative;
}
.lesson-menu-dropdown > summary {
  list-style: none;
}
.lesson-menu-dropdown > summary::-webkit-details-marker { display: none; }
.lesson-menu-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  width: 235px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(15,23,42,.14);
}
.lesson-menu-popover--right { left: auto; right: 0; width: 220px; }
.lesson-menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  font: inherit;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.lesson-menu-item:hover { background: #f8fafc; color: var(--text); }
.lesson-menu-item .lesson-nav-icon { color: #667085; }
.lesson-menu-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .65rem;
  font-weight: 800;
}
.lesson-menu-user {
  margin: 2px 4px 6px;
  padding: 7px 8px 9px;
  border-bottom: 1px solid #eaecf0;
  color: #667085;
  font-size: .7rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.lesson-profile-summary {
  width: 36px;
  padding: 0;
  border: 1px solid #e4e7ec;
  background: #fff;
}
.lesson-profile-summary-label { display: none; }
.lesson-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  color: #344054;
  cursor: pointer;
}
.lesson-menu-toggle:hover { background: #f8fafc; }
.lesson-menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}
.ai-quota-pill {
  min-height: 32px;
  gap: 4px;
  padding: 5px 8px;
  font-size: .68rem;
}
.ai-quota-pill strong { font-size: .75rem; }
.ai-quota-label { font-weight: 800; }

@media (max-width: 1080px) and (min-width: 921px) {
  .lesson-header-row { grid-template-columns: auto minmax(80px, 1fr) auto; gap: 9px; }
  .lesson-tool-link { padding-inline: 7px; }
  .lesson-tool-primary .lesson-nav-icon { display: none; }
}

@media (max-width: 920px) {
  .lesson-header-row {
    min-height: 0;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 7px 10px;
    padding: 9px 0 8px;
  }
  .back-link { grid-column: 1; grid-row: 1; align-self: center; }
  .lesson-header-actions { grid-column: 2; grid-row: 1; }
  .lesson-module {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    order: initial;
    padding: 0 1px;
    text-align: left;
    white-space: nowrap;
  }
  .lesson-menu-toggle { display: grid; }
  .lesson-tools-nav {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    right: 0;
    width: min(320px, calc(100vw - 24px));
    display: none;
    align-items: stretch;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(15,23,42,.16);
  }
  .lesson-tools-nav.is-open { display: grid; gap: 2px; }
  .lesson-tool-link,
  .lesson-profile-summary {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 10px 11px;
    font-size: .82rem;
  }
  .lesson-tool-primary .lesson-nav-icon { display: block; }
  .lesson-menu-dropdown { width: 100%; }
  .lesson-menu-dropdown > summary { width: 100%; }
  .lesson-menu-chevron { margin-left: auto; }
  .lesson-menu-popover,
  .lesson-menu-popover--right {
    position: static;
    width: auto;
    margin: 1px 0 5px 28px;
    padding: 3px;
    border: 0;
    border-left: 1px solid #e4e7ec;
    border-radius: 0;
    box-shadow: none;
  }
  .lesson-menu-item { min-height: 42px; }
  .lesson-profile-summary {
    border: 0;
    background: transparent;
  }
  .lesson-profile-summary-label { display: inline; }
  .lesson-menu-user { display: none; }
  .ai-quota-pill {
    min-width: 58px;
    justify-content: center;
    padding-inline: 8px;
  }
}

@media (max-width: 420px) {
  .back-link { font-size: .78rem; }
  .lesson-module { font-size: .72rem; }
  .ai-quota-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ai-quota-pill { min-width: 45px; }
}

/* =========================================================
   Recorrido por etapas · v2.6
   Capa visual sobre los módulos 0–15
   ========================================================= */
.course-stage--understand {
  --stage-accent: #2563eb;
  --stage-accent-dark: #1d4ed8;
  --stage-soft: #eff6ff;
  --stage-border: #bfdbfe;
  --stage-ink: #1e40af;
}
.course-stage--use {
  --stage-accent: #0f9f73;
  --stage-accent-dark: #087b59;
  --stage-soft: #ecfdf5;
  --stage-border: #a7f3d0;
  --stage-ink: #047857;
}
.course-stage--build {
  --stage-accent: #7c3aed;
  --stage-accent-dark: #6d28d9;
  --stage-soft: #f5f3ff;
  --stage-border: #ddd6fe;
  --stage-ink: #6d28d9;
}
.course-stage--implant {
  --stage-accent: #d97706;
  --stage-accent-dark: #b45309;
  --stage-soft: #fffbeb;
  --stage-border: #fde68a;
  --stage-ink: #a16207;
}

.global-progress small {
  margin-top: 7px;
  color: rgba(255,255,255,.78);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.course-stage-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.course-stage-overview__item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--stage-border);
  border-radius: 15px;
  background: rgba(255,255,255,.82);
  color: var(--text);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.course-stage-overview__item:hover {
  transform: translateY(-1px);
  border-color: var(--stage-accent);
  box-shadow: 0 8px 20px rgba(20,33,61,.07);
}
.course-stage-overview__item.is-current {
  background: var(--stage-soft);
  border-color: var(--stage-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stage-accent) 20%, transparent);
}
.course-stage-overview__number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--stage-soft);
  color: var(--stage-ink);
  font-size: .78rem;
  font-weight: 900;
}
.course-stage-overview__item.is-current .course-stage-overview__number {
  background: var(--stage-accent);
  color: #fff;
}
.course-stage-overview__copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}
.course-stage-overview__copy small {
  color: #98a2b3;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.course-stage-overview__copy strong {
  margin-top: 3px;
  overflow: hidden;
  color: #344054;
  font-size: .83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.course-stage-overview__percent {
  color: var(--stage-ink);
  font-size: .72rem;
  font-weight: 850;
}

.course-stages {
  display: grid;
  gap: 34px;
  margin-top: 30px;
}
.course-stage {
  --stage-accent: #2563eb;
  --stage-accent-dark: #1d4ed8;
  --stage-soft: #eff6ff;
  --stage-border: #bfdbfe;
  --stage-ink: #1e40af;
  scroll-margin-top: 88px;
}
.course-stage__header {
  display: grid;
  grid-template-columns: minmax(220px,.85fr) minmax(280px,1.45fr) auto;
  align-items: center;
  gap: 24px;
  padding: 20px 22px;
  border: 1px solid var(--stage-border);
  border-radius: 20px;
  background: linear-gradient(120deg, var(--stage-soft) 0%, #fff 68%);
}
.course-stage__identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.course-stage__number {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--stage-accent);
  color: #fff;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--stage-accent) 24%, transparent);
  font-size: 1rem;
  font-weight: 900;
}
.course-stage__kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--stage-ink);
  font-size: .65rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.course-stage__header h2 {
  margin: 0;
  color: #101828;
  font-size: 1.25rem;
  line-height: 1.1;
}
.course-stage__description p {
  margin: 0;
  color: #475467;
  font-size: .9rem;
  line-height: 1.55;
}
.course-stage__description span {
  display: inline-block;
  margin-top: 6px;
  color: #98a2b3;
  font-size: .72rem;
  font-weight: 700;
}
.course-stage__progress {
  min-width: 118px;
  display: grid;
  justify-items: end;
  text-align: right;
}
.course-stage__progress strong {
  color: var(--stage-ink);
  font-size: 1.55rem;
  line-height: 1;
}
.course-stage__progress span {
  margin-top: 5px;
  color: #667085;
  font-size: .68rem;
  white-space: nowrap;
}
.stage-module-list {
  gap: 14px;
  margin-top: 14px;
}
.course-stage .module-card--stage {
  position: relative;
  overflow: hidden;
  border-color: var(--stage-border);
  background: #fff;
  box-shadow: 0 8px 24px rgba(20,33,61,.045);
}
.course-stage .module-card--stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--stage-accent);
}
.course-stage .module-card--stage .module-head {
  margin: -24px -24px 0;
  padding: 22px 24px 20px 28px;
  border-bottom: 1px solid var(--stage-border);
  background: linear-gradient(115deg, var(--stage-soft) 0%, color-mix(in srgb, var(--stage-soft) 58%, #fff) 58%, #fff 100%);
}
.course-stage .module-card--stage .module-head h2 {
  color: #101828;
}
.course-stage .module-card--stage .module-progress strong {
  color: var(--stage-ink);
}
.course-stage .module-card--stage .status-pill {
  border: 1px solid color-mix(in srgb, var(--stage-accent) 18%, var(--stage-border));
  background: color-mix(in srgb, var(--stage-soft) 82%, #fff);
  color: var(--stage-ink);
}
.course-stage .module-card--stage > .progress-track.compact {
  margin-top: 18px;
}
.course-stage .module-card--stage .compact .progress-fill {
  background: var(--stage-accent);
}
.course-stage .module-card--stage .lesson-list {
  border-color: color-mix(in srgb, var(--stage-border) 55%, var(--line));
  background: #fff;
}
.course-stage .module-card--stage .lesson-row:hover {
  background: color-mix(in srgb, var(--stage-soft) 52%, #fff);
}

/* Contexto de etapa dentro de la cabecera de lección */
.lesson-stage-header {
  --stage-accent: #2563eb;
  --stage-ink: #1e40af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lesson-stage-header strong {
  color: var(--stage-ink);
  font-size: .73rem;
  font-weight: 800;
}
.lesson-stage-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--stage-accent);
}
.lesson-stage-divider {
  color: #c2c7d0;
}
.lesson-stage-module {
  min-width: 0;
  overflow: hidden;
  color: #7b8495;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .course-stage-overview { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .course-stage__header {
    grid-template-columns: minmax(220px,1fr) minmax(260px,1.4fr);
  }
  .course-stage__progress {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    text-align: left;
  }
  .course-stage__progress strong { font-size: 1.25rem; }
  .lesson-stage-module { display: none; }
  .lesson-stage-divider { display: none; }
}

@media (max-width: 720px) {
  .course-stage-overview { margin-top: 12px; }
  .course-stage__header {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 18px;
  }
  .course-stage__progress { grid-column: auto; }
  .course-stage__description p { font-size: .86rem; }
  .course-stages { gap: 28px; margin-top: 24px; }
  .stage-module-list { margin-top: 11px; }
  .global-progress small { white-space: normal; }
}

@media (max-width: 520px) {
  .course-stage-overview { grid-template-columns: 1fr; }
  .course-stage-overview__item { padding: 11px 12px; }
  .course-stage__number { width: 40px; height: 40px; flex-basis: 40px; }
  .course-stage__header h2 { font-size: 1.12rem; }
  .lesson-stage-header strong { font-size: .7rem; }
}

@media (max-width: 720px) {
  .course-stage .module-card--stage .module-head {
    margin: -24px -24px 0;
    padding: 20px 20px 18px 26px;
  }
}

/* =========================================================
   Correccion de herencia de color por etapa · v2.6.2
   Las reglas genericas de .course-stage y .lesson-stage-header
   no deben pisar la paleta especifica de cada etapa.
   ========================================================= */
.course-stage.course-stage--understand,
.lesson-stage-header.course-stage--understand {
  --stage-accent: #2563eb;
  --stage-accent-dark: #1d4ed8;
  --stage-soft: #eff6ff;
  --stage-border: #bfdbfe;
  --stage-ink: #1e40af;
}

.course-stage.course-stage--use,
.lesson-stage-header.course-stage--use {
  --stage-accent: #0f9f73;
  --stage-accent-dark: #087b59;
  --stage-soft: #ecfdf5;
  --stage-border: #a7f3d0;
  --stage-ink: #047857;
}

.course-stage.course-stage--build,
.lesson-stage-header.course-stage--build {
  --stage-accent: #7c3aed;
  --stage-accent-dark: #6d28d9;
  --stage-soft: #f5f3ff;
  --stage-border: #ddd6fe;
  --stage-ink: #6d28d9;
}

.course-stage.course-stage--implant,
.lesson-stage-header.course-stage--implant {
  --stage-accent: #d97706;
  --stage-accent-dark: #b45309;
  --stage-soft: #fffbeb;
  --stage-border: #fde68a;
  --stage-ink: #a16207;
}

@media (max-width: 460px) {
  .menu-link { flex-basis: 100%; }
  .menu-link span:last-child { white-space: nowrap; }
  .user-pill__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* =========================================================
   Módulos 0 y 1 · Refuerzo visual sin modificar contenido editorial
   2026-09-16
   ========================================================= */

/* Módulo 0 · convertir contenido existente en bloques más visuales */
[data-mp-block="m00_l02_idea"] {
  margin: 14px 0 22px;
  padding: 20px 22px;
  border: 1px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 8px 22px rgba(37,99,235,.05);
}

ul[data-mp-block="m00_l02_desarrollo"] {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  counter-reset: mp-m00-concepts;
}
ul[data-mp-block="m00_l02_desarrollo"] li {
  position: relative;
  min-height: 78px;
  margin: 0;
  padding: 16px 16px 16px 52px;
  border: 1px solid #dbe3ee;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(15,23,42,.035);
  counter-increment: mp-m00-concepts;
}
ul[data-mp-block="m00_l02_desarrollo"] li::before {
  content: counter(mp-m00-concepts);
  position: absolute;
  top: 15px;
  left: 15px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d4ed8;
  font-size: .72rem;
  font-weight: 850;
}

ul[data-mp-block="m00_l03_mapa"] {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
ul[data-mp-block="m00_l03_mapa"] li {
  position: relative;
  margin: 0;
  padding: 18px 18px 18px 20px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: linear-gradient(145deg,#fff 0%,#f8fbff 100%);
  box-shadow: 0 7px 20px rgba(15,23,42,.035);
}
ul[data-mp-block="m00_l03_mapa"] li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  border-radius: 16px 0 0 16px;
  background: #2563eb;
}
ul[data-mp-block="m00_l03_mapa"] li:nth-child(2)::after { background: #0f9f73; }
ul[data-mp-block="m00_l03_mapa"] li:nth-child(3)::after { background: #7c3aed; }
ul[data-mp-block="m00_l03_mapa"] li:nth-child(4)::after { background: #d97706; }
ul[data-mp-block="m00_l03_mapa"] li:nth-child(5)::after { background: #db2777; }
ul[data-mp-block="m00_l03_mapa"] li:last-child { grid-column: 1 / -1; }
ul[data-mp-block="m00_l03_mapa"] strong {
  display: inline-block;
  margin-bottom: 5px;
  color: #0f172a;
}

[data-mp-block="m00_l04_intro"] {
  font-size: 1.08rem;
  line-height: 1.7;
}
ul[data-mp-block="m00_l04_casos"] {
  list-style: none;
  padding: 0;
  margin: 18px 0 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
ul[data-mp-block="m00_l04_casos"] li {
  position: relative;
  margin: 0;
  min-height: 76px;
  padding: 16px 16px 16px 48px;
  border: 1px solid #d9eadf;
  border-radius: 15px;
  background: linear-gradient(145deg,#ffffff 0%,#f3fbf7 100%);
}
ul[data-mp-block="m00_l04_casos"] li::before {
  content: "✓";
  position: absolute;
  top: 15px;
  left: 15px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: .78rem;
  font-weight: 900;
}
ul[data-mp-block="m00_l04_casos"] li:last-child { grid-column: 1 / -1; }
[data-mp-block="m00_l04_critico"] {
  padding: 16px 18px;
  border-left: 4px solid #f59e0b;
  border-radius: 0 14px 14px 0;
  background: #fffaf0;
}

/* Módulo 1 · potenciar los visuales que ya forman parte del contenido */
[data-mp-block="m01_l01_timeline_svg"],
[data-mp-block="m01_l02_map_svg"],
[data-mp-block="m01_l02_llm_tools_svg"],
[data-mp-block="m01_l02_assistant_svg"],
[data-mp-block="m01_l03_flow_svg"],
[data-mp-block="m01_l03_context_svg"] {
  margin: 28px 0 34px;
  border-color: #d7e2f2;
  background: linear-gradient(180deg,#fbfdff 0%,#f7f9fc 100%);
  box-shadow: 0 10px 28px rgba(15,23,42,.045);
}

[data-mp-block="m01_l01_timeline_svg"] .timeline-item {
  box-shadow: 0 5px 14px rgba(15,23,42,.035);
}
[data-mp-block="m01_l01_timeline_svg"] .timeline-item:nth-child(2) .timeline-year { background:#e9fbf3; color:#087b59; }
[data-mp-block="m01_l01_timeline_svg"] .timeline-item:nth-child(3) .timeline-year { background:#fff4df; color:#b45309; }
[data-mp-block="m01_l01_timeline_svg"] .timeline-item:nth-child(4) .timeline-year { background:#f4edff; color:#6d28d9; }
[data-mp-block="m01_l01_timeline_svg"] .timeline-item:nth-child(5) .timeline-year { background:#ffeef2; color:#be123c; }
[data-mp-block="m01_l01_timeline_svg"] .timeline-item:nth-child(6) .timeline-year { background:#e8f8fb; color:#0e7490; }
[data-mp-block="m01_l01_timeline_svg"] .timeline-item--accent {
  border-width: 2px;
  background: linear-gradient(135deg,#edf5ff 0%,#f7fbff 100%);
}

[data-mp-block="m01_l02_map_svg"] .concept-step {
  box-shadow: 0 5px 14px rgba(15,23,42,.03);
}
[data-mp-block="m01_l02_map_svg"] .concept-arrow {
  opacity: .72;
}

[data-mp-block="m01_l03_flow_svg"] .process-step:nth-of-type(1),
[data-mp-block="m01_l03_flow_svg"] .process-step:nth-of-type(3) {
  background: #f4f8ff;
  border-color: #bfdbfe;
}
[data-mp-block="m01_l03_flow_svg"] .process-step:nth-of-type(2) {
  background: #f2fbf7;
  border-color: #bbf7d0;
}

[data-mp-block="m01_l03_context_svg"] .context-sources span:nth-child(1) { border-left: 4px solid #2563eb; }
[data-mp-block="m01_l03_context_svg"] .context-sources span:nth-child(2) { border-left: 4px solid #0f9f73; }
[data-mp-block="m01_l03_context_svg"] .context-sources span:nth-child(3) { border-left: 4px solid #7c3aed; }
[data-mp-block="m01_l03_context_svg"] .context-sources span:nth-child(4) { border-left: 4px solid #d97706; }
[data-mp-block="m01_l03_context_svg"] .context-sources span:nth-child(5) { border-left: 4px solid #db2777; }

[data-mp-block="m01_l02_examples_grid"],
[data-mp-block="m01_l02_tool_examples"],
[data-mp-block="m01_l03_cards"] {
  margin: 22px 0 30px;
}
[data-mp-block="m01_l02_examples_grid"] .mini-card,
[data-mp-block="m01_l02_tool_examples"] .mini-card,
[data-mp-block="m01_l03_cards"] .mini-card {
  border-top: 3px solid #dbeafe;
  box-shadow: 0 6px 18px rgba(15,23,42,.035);
}
[data-mp-block="m01_l02_examples_grid"] .mini-card:nth-child(2),
[data-mp-block="m01_l02_tool_examples"] .mini-card:nth-child(2),
[data-mp-block="m01_l03_cards"] .mini-card:nth-child(2) { border-top-color:#bbf7d0; }
[data-mp-block="m01_l02_examples_grid"] .mini-card:nth-child(3),
[data-mp-block="m01_l02_tool_examples"] .mini-card:nth-child(3),
[data-mp-block="m01_l03_cards"] .mini-card:nth-child(3) { border-top-color:#ddd6fe; }
[data-mp-block="m01_l02_examples_grid"] .mini-card:nth-child(4),
[data-mp-block="m01_l02_tool_examples"] .mini-card:nth-child(4),
[data-mp-block="m01_l03_cards"] .mini-card:nth-child(4) { border-top-color:#fed7aa; }

@media (max-width: 720px) {
  ul[data-mp-block="m00_l02_desarrollo"],
  ul[data-mp-block="m00_l03_mapa"],
  ul[data-mp-block="m00_l04_casos"] {
    grid-template-columns: 1fr;
  }
  ul[data-mp-block="m00_l03_mapa"] li:last-child,
  ul[data-mp-block="m00_l04_casos"] li:last-child {
    grid-column: auto;
  }
}

/* =========================================================
   Índice · navegación móvil compacta · v2.6.5
   ========================================================= */
.index-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid #e4e7ec;
  border-radius: 11px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(16,24,40,.02);
}
.index-menu-toggle:hover { background: #f8fafc; }
.index-menu-toggle:focus-visible {
  outline: 3px solid #dbeafe;
  outline-offset: 2px;
}
.index-menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

@media (max-width: 720px) {
  .course-header .header-row {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .index-brand-block {
    min-width: 0;
  }
  .course-header .brand {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
  }
  .course-header .header-subtitle {
    display: none;
  }
  .user-menu--index {
    position: relative;
    width: auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .user-menu--index .user-pill {
    flex: 0 0 auto;
    gap: 0;
    padding: 0;
  }
  .user-menu--index .user-pill__name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .user-menu--index .user-pill__avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .user-menu--index .ai-quota-pill {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 5px 8px;
    white-space: nowrap;
  }
  .index-menu-toggle {
    display: grid;
  }
  .index-top-nav {
    position: absolute;
    z-index: 80;
    top: calc(100% + 9px);
    right: 0;
    width: min(292px, calc(100vw - 24px));
    display: none;
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(15,23,42,.16);
  }
  .index-top-nav.is-open {
    display: grid;
  }
  .index-top-nav .menu-link {
    width: 100%;
    min-height: 44px;
    flex: none;
    justify-content: flex-start;
    padding: 9px 10px;
    border-color: transparent;
    box-shadow: none;
  }
  .index-top-nav .menu-link:hover {
    transform: none;
  }
}

@media (max-width: 430px) {
  .course-header .container {
    width: min(100% - 20px, 1120px);
  }
  .user-menu--index .ai-quota-pill {
    font-size: .64rem;
    padding-inline: 7px;
  }
  .user-menu--index .ai-quota-symbol {
    display: none;
  }
}

/* =========================================================
   Recorrido recomendado · vista híbrida generalista/personal · v2.7
   ========================================================= */
.itinerary-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dce4ef;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(124,58,237,.075), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 28px rgba(15,23,42,.045);
}
.itinerary-card__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.itinerary-card__top h2 {
  max-width: 760px;
  margin: 4px 0 0;
  color: #101828;
  font-size: 1.12rem;
  line-height: 1.35;
}
.itinerary-switch {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #f2f4f7;
}
.itinerary-switch__button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #667085;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.itinerary-switch__button:hover:not(:disabled) { color: #344054; }
.itinerary-switch__button.is-active {
  background: #fff;
  color: #101828;
  box-shadow: 0 2px 8px rgba(15,23,42,.09);
}
.itinerary-switch__button[data-itinerary-view="personalized"].is-active {
  color: #6d28d9;
}
.itinerary-switch__button:focus-visible {
  outline: 3px solid #ddd6fe;
  outline-offset: 2px;
}
.itinerary-switch__button:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.itinerary-slider {
  overflow: hidden;
  margin-top: 15px;
  border: 1px solid #e7ebf0;
  border-radius: 16px;
  background: rgba(255,255,255,.86);
}
.itinerary-slider__track {
  width: 200%;
  display: flex;
  align-items: stretch;
  transition: transform .34s cubic-bezier(.2,.72,.2,1);
}
.itinerary-card.is-personalized .itinerary-slider__track {
  transform: translateX(-50%);
}
.itinerary-panel {
  width: 50%;
  min-width: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 17px 18px;
}
.itinerary-panel--personal {
  background: linear-gradient(120deg, #faf7ff 0%, #fff 72%);
}
.itinerary-panel__copy strong,
.itinerary-personal-summary strong {
  color: #101828;
  font-size: .9rem;
}
.itinerary-panel__copy p,
.itinerary-personal-summary p {
  margin: 4px 0 0;
  max-width: 760px;
  color: #667085;
  font-size: .8rem;
  line-height: 1.55;
}
.itinerary-panel__metric {
  min-width: 122px;
  display: grid;
  justify-items: end;
  color: #667085;
  text-align: right;
}
.itinerary-panel__metric strong {
  color: #344054;
  font-size: 1.45rem;
  line-height: 1;
}
.itinerary-panel__metric span {
  margin-top: 4px;
  font-size: .68rem;
  font-weight: 700;
}
.itinerary-personal-summary {
  min-width: 0;
  flex: 1 1 auto;
}
.itinerary-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.itinerary-focus span {
  padding: 5px 8px;
  border: 1px solid #e4dcff;
  border-radius: 999px;
  background: #f6f2ff;
  color: #6d28d9;
  font-size: .67rem;
  font-weight: 800;
}
.itinerary-stats {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(112px,1fr));
  gap: 6px;
}
.itinerary-stats > span,
.itinerary-stat-filter {
  display: grid;
  position: relative;
  padding: 8px 10px;
  border: 1px solid #e8e4f1;
  border-radius: 11px;
  background: rgba(255,255,255,.82);
  color: #667085;
  font: inherit;
  font-size: .65rem;
  line-height: 1.25;
  text-align: left;
}
.itinerary-stats strong {
  color: #344054;
  font-size: .9rem;
}
.itinerary-stats small {
  margin-top: 3px;
  color: #98a2b3;
  font-size: .58rem;
  font-weight: 700;
}
.itinerary-stat-filter {
  padding-right: 30px;
  cursor: pointer;
  transition: opacity .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}
.itinerary-stat-filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15,23,42,.07);
}
.itinerary-stat-filter::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2f6;
  color: #667085;
  font-size: .62rem;
  font-weight: 900;
}
.itinerary-stat-filter--essential.is-active { border-color: #bfd1ff; background: #f7f9ff; }
.itinerary-stat-filter--essential.is-active::after { background: #dbe7ff; color: #244aa5; }
.itinerary-stat-filter--recommended.is-active { border-color: #a7f3d0; background: #f3fdf8; }
.itinerary-stat-filter--recommended.is-active::after { background: #d1fae5; color: #047857; }
.itinerary-stat-filter--extension.is-active { border-color: #d6dae1; background: #fbfcfd; }
.itinerary-stat-filter--extension.is-active::after { background: #edf0f4; color: #475467; }
.itinerary-stat-filter:not(.is-active) {
  opacity: .45;
  background: #f8fafc;
  box-shadow: none;
}
.itinerary-stat-filter:not(.is-active)::after {
  content: "";
  border: 1px solid #cfd5df;
  background: #fff;
}
.itinerary-stat-filter:focus-visible {
  outline: 3px solid #ddd6fe;
  outline-offset: 2px;
}
.itinerary-stats__progress {
  border-color: #d9cfff !important;
  background: #faf8ff !important;
}
.itinerary-stats__progress strong { color: #6d28d9; }

.module-kickers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.module-kickers .status-pill { margin: 0; }
.itinerary-module-badge,
.itinerary-module-reason {
  display: none;
}
.itinerary-module-badge {
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .02em;
}
.itinerary-module-badge--essential {
  border-color: #c7d7fe;
  background: #eef4ff;
  color: #244aa5;
}
.itinerary-module-badge--recommended {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}
.itinerary-module-badge--extension {
  border-color: #e4e7ec;
  background: #f8fafc;
  color: #667085;
}
.itinerary-module-reason {
  margin: 8px 0 0 !important;
  color: #087b59 !important;
  font-size: .72rem !important;
  font-weight: 700;
  line-height: 1.45 !important;
}
#courseIndexMain[data-course-view="personalized"] .itinerary-module-badge,
#courseIndexMain[data-course-view="personalized"] .itinerary-module-reason {
  display: inline-flex;
}
#courseIndexMain[data-course-view="personalized"] .module-card--itinerary-recommended {
  border-color: #a7f3d0;
  box-shadow: 0 10px 30px rgba(15,159,115,.08);
}
#courseIndexMain[data-course-view="personalized"] .module-card--itinerary-recommended::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 78px;
  height: 78px;
  pointer-events: none;
  background: radial-gradient(circle at 100% 0%, rgba(15,159,115,.11), transparent 67%);
}
#courseIndexMain[data-course-view="personalized"] .module-card--itinerary-extension {
  border-color: #e4e7ec;
  box-shadow: 0 5px 16px rgba(15,23,42,.025);
}
#courseIndexMain[data-course-view="personalized"] .module-card--itinerary-extension .module-head {
  filter: saturate(.72);
}
#courseIndexMain[data-course-view="personalized"] .module-card--itinerary-extension .itinerary-module-reason {
  color: #667085 !important;
}


/* Afinado por lección dentro del recorrido personalizado */
.lesson-path-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}
.lesson-path-badge--essential {
  border-color: #c7d7fe;
  background: #eef4ff;
  color: #244aa5;
}
.lesson-path-badge--recommended {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}
.lesson-path-badge--extension {
  border-color: #e4e7ec;
  background: #f8fafc;
  color: #667085;
}
#courseIndexMain[data-course-view="personalized"] .lesson-row {
  grid-template-columns: 12px minmax(0,1fr) auto auto auto;
}
#courseIndexMain[data-course-view="personalized"] .lesson-path-badge {
  display: inline-flex;
}
#courseIndexMain[data-course-view="personalized"] .lesson-row--itinerary-recommended {
  background: linear-gradient(90deg, rgba(236,253,245,.55), transparent 28%);
}
#courseIndexMain[data-course-view="personalized"] .lesson-row--itinerary-extension {
  color: #667085;
}
#courseIndexMain[data-course-view="personalized"] .lesson-row--itinerary-extension .lesson-title {
  font-weight: 550;
}
#courseIndexMain .is-itinerary-hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .itinerary-card__top {
    align-items: stretch;
    flex-direction: column;
  }
  .itinerary-switch {
    align-self: flex-start;
  }
  .itinerary-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .itinerary-panel__metric {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }
  .itinerary-stats {
    width: 100%;
  }
}

@media (max-width: 720px) {
  #courseIndexMain[data-course-view="personalized"] .lesson-row {
    grid-template-columns: 10px minmax(0,1fr) auto auto;
  }
}

@media (max-width: 600px) {
  .itinerary-card {
    margin-top: 14px;
    padding: 13px;
    border-radius: 17px;
  }
  .itinerary-card__top h2 { font-size: 1rem; }
  .itinerary-switch {
    width: 100%;
  }
  .itinerary-switch__button {
    padding-inline: 8px;
    font-size: .72rem;
  }
  .itinerary-panel {
    padding: 14px;
  }
  .itinerary-stats {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  #courseIndexMain[data-course-view="personalized"] .lesson-row {
    grid-template-columns: 10px minmax(0,1fr) auto;
  }
  #courseIndexMain[data-course-view="personalized"] .lesson-path-badge {
    grid-column: 2;
    justify-self: start;
    margin-top: -5px;
  }
  #courseIndexMain[data-course-view="personalized"] .lesson-action {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

/* Modalidades: explicación contextual, sin peticiones de IA para Básica. */
.premium-preview{margin:28px 0;padding:26px;border:1px solid #d8d7ff;border-left:4px solid #6652ee;border-radius:18px;background:linear-gradient(135deg,#faf9ff,#fff);color:#17233d}
.premium-preview__kicker{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:.72rem;font-weight:800;letter-spacing:.07em;color:#5747d9}
.premium-preview__kicker>span{border-radius:20px;background:#ece8ff;padding:4px 10px;font-size:.65rem}
.premium-preview h3{margin:13px 0 10px;font-size:1.3rem;line-height:1.35}
.premium-preview p{margin:10px 0 16px;line-height:1.7}
.premium-preview__benefits{display:flex;flex-wrap:wrap;gap:10px 22px;list-style:none;padding:0!important;margin:0 0 22px!important;font-size:.84rem;color:#50607b}
.premium-preview__benefits li:before{content:'✓';color:#5747d9;margin-right:6px;font-weight:800}
.premium-preview .btn{display:inline-flex;align-items:center;gap:6px;white-space:normal}
.premium-preview small{display:block;margin-top:12px;font-size:.76rem;color:#66748a;line-height:1.5}
.premium-plan-link{display:inline-flex;align-items:center;gap:8px;border:1px solid #d8d7ff;background:#faf9ff;border-radius:20px;padding:6px 10px;text-decoration:none;color:#17233d;font-weight:750;font-size:.75rem}
.premium-plan-link span{color:#5747d9;font-weight:650}
.premium-basic-practice{margin-top:22px}
.lesson-card,.lesson-content{min-width:0}
.lesson-content pre{box-sizing:border-box;min-width:0;max-width:100%;overflow-x:auto}
.lesson-content .visual-flow{max-width:100%;min-width:0;flex-wrap:wrap}
.lesson-content .visual-node{min-width:0;max-width:100%;overflow-wrap:anywhere}
@media(max-width:600px){
 .premium-preview{padding:20px;margin:22px 0}
 .premium-preview__benefits{display:grid;gap:8px}
 .premium-preview .btn{display:flex;justify-content:center;width:100%}
 .lesson-header .premium-plan-link{font-size:.65rem;padding:4px 7px;gap:5px}
 .lesson-content .visual-flow{flex-direction:column;align-items:stretch}
 .lesson-content .visual-flow .visual-node{width:100%;flex:auto}
 .lesson-content .visual-flow .visual-arrow{align-self:center;transform:rotate(90deg)}
}

/* Vista previa interna del minicurso, visible solo para master. */
.mp-preview-badge{display:inline-flex;align-items:center;border:1px solid #e2b680;background:#fff4e1;color:#744d13;font-size:.76rem;font-weight:750;padding:7px 11px;border-radius:999px;margin-top:9px}

/* Productividad personal: orientación específica, sin alterar lecciones editoriales. */
.mp-personal-goal{margin:0 0 30px;border:1px solid #cae5dc;border-radius:20px;background:linear-gradient(125deg,#f3fbf6,#f7fafc);padding:clamp(20px,3.4vw,34px);box-shadow:0 10px 25px rgba(10,62,57,.045)}
.mp-personal-goal__heading h2{margin:8px 0;font-size:clamp(1.35rem,2.6vw,1.8rem);color:#153f45;letter-spacing:-.025em}
.mp-personal-goal__heading p{max-width:780px;line-height:1.65;color:#50636c;margin:0 0 24px}
.mp-personal-goal__steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.mp-personal-goal__steps>div{padding:16px;background:white;border-radius:13px;border:1px solid #dcece6;display:flex;flex-direction:column;gap:7px}
.mp-personal-goal__steps span{color:#11876c;font-size:.74rem;font-weight:850;letter-spacing:.12em}
.mp-personal-goal__steps strong{font-size:1.06rem;color:#183947}
.mp-personal-goal__steps small{font-size:.82rem;line-height:1.45;color:#5e6f79}
.mp-personal-goal__foot{margin:21px 0 0;color:#48636b;font-size:.93rem;line-height:1.55}
@media(max-width:760px){.mp-personal-goal__steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.mp-personal-goal__steps{grid-template-columns:1fr 1fr;gap:8px}.mp-personal-goal__steps>div{padding:12px}}
