/* Superatec Plus — lecciones: video, libreta de notas y dudas al facilitador.
 * Mismo lenguaje que la portada y el acceso: azul profundo del hero, punto verde que titila,
 * botones --lp-blue con sombra, fichas de color para los iconos y tarjetas de 20px. */

:root { --lt-hero: radial-gradient(520px 260px at 90% 0%, rgba(56, 189, 248, .22), transparent 70%), linear-gradient(135deg, #0a4f7c 0%, #073b5e 55%, #041f33 100%); }

.content.has-lt, .lesson, .lt { min-width: 0; }

/* Video */
.lesson-video { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #041f33;
  box-shadow: 0 18px 40px rgba(4, 31, 51, .28); outline: 1px solid rgba(255, 255, 255, .06); }
.lesson-video iframe, .lesson-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.lesson-text { margin-top: 1.75rem; }

/* Panel */
.lt { margin-top: 1.25rem; background: var(--card); border-radius: 20px; box-shadow: var(--shadow, 0 10px 30px rgba(15, 31, 51, .08)); overflow: hidden; }
html[data-theme="dark"] .lt { border: 1px solid var(--line); }
.lt > .loading { padding: 1.5rem; }

.lt-head { background: var(--lt-hero); color: #fff; padding: 14px 16px 16px; }
.lt-grab { display: none; }
.lt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.lt-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #bfe6fb; }
.lt-kicker b { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: lp-titila 1.6s ease-in-out infinite; }
.lt-kicker b::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #4ade80; animation: lp-onda 1.6s ease-out infinite; }
.lt-close { display: none; }

/* Pestañas segmentadas sobre el azul */
.lt-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.lt-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 11px;
  background: none; color: #dbeefa; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; white-space: nowrap; min-width: 0;
  transition: background .18s, color .18s; }
.lt-tabs button span { overflow: hidden; text-overflow: ellipsis; }
.lt-tabs button .lp-ico { width: 18px; height: 18px; flex: none; }
.lt-tabs button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.lt-tabs button.on { background: #fff; color: #073b5e; box-shadow: 0 6px 16px rgba(0, 20, 40, .25); }
.lt-tabs button b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: .72rem; display: inline-grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .2); color: #fff; }
.lt-tabs button.on b { background: var(--lp-blue); color: #fff; }
.lt-tabs button:focus-visible, .lt-close:focus-visible { outline: 3px solid #7dd3fc; outline-offset: 2px; }

.lt-body { padding: 18px; }

/* Escribir */
.lt-form { background: var(--bg); border-radius: 16px; padding: 12px; }
.lt-form textarea, .lt-item textarea { display: block; width: 100%; resize: vertical; min-height: 72px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
.lt-form textarea:focus, .lt-item textarea:focus { outline: none; border-color: var(--lp-blue); box-shadow: 0 0 0 4px rgba(10, 133, 199, .16); }
.lt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.lt-btns { display: flex; gap: 8px; }
.lt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--lp-blue); color: #fff; font: inherit; font-weight: 800; font-size: .92rem; box-shadow: 0 8px 18px rgba(10, 133, 199, .28);
  transition: background .15s, transform .15s, box-shadow .15s; }
.lt-btn:hover { background: #0b93db; transform: translateY(-1px); }
.lt-btn:active { transform: none; }
.lt-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.lt-btn .lp-ico { width: 17px; height: 17px; }
.lt-btn.ghost { background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.lt-btn.ghost:hover { color: var(--brand); background: var(--brand-50); }
.lt-check { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.lt-check input { width: 18px; height: 18px; accent-color: var(--lp-blue); }
.lt-hint { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-3); margin: 0; }
.lt-hint .lp-ico { width: 15px; height: 15px; flex: none; }
.lt-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--brand-50); color: var(--ink-2); font-size: .86rem; line-height: 1.45; }
.lt-note .lp-ico { width: 18px; height: 18px; flex: none; color: var(--lp-blue); margin-top: 1px; }
.lt-warn { background: #fff4e0; color: #7c4a03; border-radius: 12px; padding: 10px 12px; font-size: .86rem; margin-bottom: 12px; }
html[data-theme="dark"] .lt-warn { background: rgba(245, 158, 11, .14); color: #fcd34d; }

/* Filtro segmentado (facilitador) */
.lt-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); margin-bottom: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.lt-seg::-webkit-scrollbar { display: none; }
.lt-seg button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.lt-seg button.on { background: var(--card); color: var(--brand); box-shadow: 0 4px 12px rgba(15, 31, 51, .1); }
.lt-seg button small { opacity: .7; margin-left: 4px; }

/* Lista */
.lt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.lt-item { border-radius: 16px; padding: 12px 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.lt-item:hover { box-shadow: inset 0 0 0 1px var(--line), 0 8px 20px rgba(15, 31, 51, .07); }
.lt-item.editing { box-shadow: inset 0 0 0 2px var(--lp-blue); }
.lt-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lt-meta small { color: var(--ink-3); font-size: .78rem; }
.lt-meta .grow { flex: 1; }
.lt-who { font-size: .92rem; }
.lt-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; color: var(--ink); }
.lt-time { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--brand-50); color: var(--lp-blue); font: inherit; font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.lt-time .lp-ico { width: 14px; height: 14px; }
.lt-time:hover { background: var(--lp-blue); color: #fff; }
.lt-ib { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: none; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s; }
.lt-ib .lp-ico { width: 18px; height: 18px; }
.lt-ib:hover { background: var(--brand-50); color: var(--brand); }
.lt-ib[data-delnote]:hover, .lt-ib[data-delq]:hover { background: #fdecec; color: #dc2626; }
html[data-theme="dark"] .lt-ib[data-delnote]:hover, html[data-theme="dark"] .lt-ib[data-delq]:hover { background: rgba(239, 68, 68, .16); color: #fca5a5; }

.lt-status { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.lt-status .lp-ico { width: 14px; height: 14px; }
.lt-status.wait { background: #fff4e0; color: #b45309; }
.lt-status.ok { background: var(--ok-50, #e7f8ef); color: var(--lp-free); }
html[data-theme="dark"] .lt-status.wait { background: rgba(245, 158, 11, .14); color: #fbbf24; }
html[data-theme="dark"] .lt-status.ok { background: rgba(16, 185, 129, .16); color: #6ee7b7; }

/* Respuesta del facilitador */
.lt-answer { display: flex; gap: 10px; margin-top: 12px; }
.lt-av { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800;
  background: #efe8fd; color: #6d28d9; }
.lt-av.sm { width: 28px; height: 28px; font-size: .7rem; background: var(--brand-50); color: var(--brand); }
html[data-theme="dark"] .lt-av { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.lt-bubble { flex: 1; min-width: 0; background: var(--bg); border-radius: 4px 16px 16px 16px; padding: 10px 12px; }
.lt-bubble small { color: var(--ink-3); font-size: .78rem; }
.lt-bubble small b { color: var(--ink); }
.lt-answer-form { margin-top: 12px; }
.lt-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--lp-blue); font: inherit; font-weight: 700; font-size: .86rem;
  cursor: pointer; padding: 6px 0; min-height: 36px; text-decoration: none; }
.lt-link .lp-ico { width: 16px; height: 16px; }
.lt-link:hover { text-decoration: underline; }
.lt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* Fichas de color (como los KPI) y estados vacíos */
.lt-chip { width: 44px; height: 44px; border-radius: 13px; display: inline-grid; place-items: center; flex: none; }
.lt-chip .lp-ico { width: 22px; height: 22px; }
.lt-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 12px; color: var(--ink-3); }
.lt-empty b { color: var(--ink); font-size: 1rem; margin-top: 6px; }
.lt-empty p { margin: 0; max-width: 38ch; font-size: .9rem; line-height: 1.5; }
.lt-empty.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow, 0 10px 30px rgba(15, 31, 51, .08)); }

/* Barra flotante del celular */
.lt-dock { display: none; }

@media (max-width: 1000px) {
  .lesson-video { border-radius: 16px; }
  .lt { position: fixed; left: 0; right: 0; bottom: 0; top: var(--lt-top, 30vh); z-index: 80; margin: 0; border-radius: 22px 22px 0 0;
    display: flex; flex-direction: column; transform: translateY(105%); visibility: hidden;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; box-shadow: 0 -16px 44px rgba(4, 31, 51, .35); }
  .lt.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  .lt-head { flex: none; padding: 6px 12px 12px; }
  .lt-grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .35); margin: 2px auto 8px; }
  .lt-top { margin-bottom: 10px; }
  .lt-close { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
  .lt-close .lp-ico { width: 20px; height: 20px; }
  .lt-tabs button { font-size: .88rem; gap: 6px; padding: 0 8px; }
  .lt-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); }
  .lt-form { padding: 10px; }
  body.lt-lock { overflow: hidden; }

  /* Píldora con el azul del hero, sobre la barra inferior */
  .lt-dock:not([hidden]) { display: flex; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 55;
    gap: 4px; padding: 5px; border-radius: 18px; background: var(--lt-hero); box-shadow: 0 14px 34px rgba(4, 31, 51, .4); }
  .lt-dock button { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 0; border-radius: 14px; font: inherit; font-weight: 800;
    font-size: .9rem; background: none; color: #fff; cursor: pointer; white-space: nowrap; }
  .lt-dock button:first-child { background: #fff; color: #073b5e; }
  .lt-dock button .lp-ico { width: 19px; height: 19px; }
  .lt-dock b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: .72rem; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .22); color: #fff; }
  .lt-dock b[hidden] { display: none; }
  .lt-dock button:first-child b { background: var(--lp-blue); }
  .content.has-lt .content-foot { margin-bottom: 72px; }
}

/* Campanita de avisos (barra superior) */
.sp-bell-wrap { position: relative; }
.sp-bell { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.sp-bell .lp-ico { width: 22px; height: 22px; }
.sp-bell:hover, .sp-bell[aria-expanded="true"] { background: var(--brand-50); color: var(--brand); }
.sp-bell:focus-visible { outline: 3px solid var(--lp-blue); outline-offset: 2px; }
.sp-bell-n { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center;
  background: #ef4444; color: #fff; font-size: .68rem; font-weight: 800; box-shadow: 0 0 0 2px var(--card); }
.sp-bell-n[hidden] { display: none; }
.sp-bell-drop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 90; width: min(360px, calc(100vw - 24px)); background: var(--card); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(4, 31, 51, .25); overflow: hidden; }
html[data-theme="dark"] .sp-bell-drop { border: 1px solid var(--line); }
.sp-bell-drop[hidden] { display: none; }
.sp-bell-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--lt-hero); color: #fff; }
.sp-bell-head small { color: #bfe6fb; font-weight: 700; }
.sp-bell-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.sp-bell-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; text-decoration: none; color: var(--ink); min-height: 56px; }
.sp-bell-item:hover { background: var(--bg); }
.sp-bell-item .lt-chip { width: 40px; height: 40px; border-radius: 12px; }
.sp-bell-item .lt-chip .lp-ico { width: 20px; height: 20px; }
.sp-bell-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-bell-item b { font-size: .9rem; }
.sp-bell-item small { color: var(--ink-3); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-bell-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 24px 18px; color: var(--ink-3); font-size: .86rem; }
.sp-bell-empty b { color: var(--ink); }
@media (max-width: 1000px) { .sp-bell-drop { position: fixed; right: 12px; top: 64px; } }

@media (prefers-reduced-motion: reduce) {
  .lt, .lt.open, .lt-btn, .lt-tabs button { transition: none; }
  .lt-kicker b, .lt-kicker b::after { animation: none; }
}

/* La píldora «Mi libreta · Dudas» flota sobre la página: se deja espacio al final para que no tape «Anterior» y «Siguiente» */
@media (max-width: 1000px) {
  body:has(.lt-dock:not([hidden])) .course-layout { padding-bottom: 76px; }
}

/* ======================================================================
 * Seguir donde quedaste y transcripción del video
 * ====================================================================== */
.lt-resume { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; padding: 10px 14px; border-radius: 14px;
  background: var(--brand-50); color: var(--ink); font-size: .92rem; }
.lt-resume > .lp-ico { width: 20px; height: 20px; color: var(--brand); flex: none; }
.lt-resume > span { flex: 1; min-width: 180px; }
.lt-resume .lt-btn .lp-ico { width: 16px; height: 16px; }
.lt-tr { margin: 10px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.lt-tr-toggle { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.lt-tr-toggle > span { flex: 1; }
.lt-tr-toggle small { color: var(--ink-3); font-weight: 600; }
.lt-tr-toggle .lp-ico { width: 18px; height: 18px; color: var(--brand); flex: none; }
.lt-tr-toggle .lp-ico:last-child { color: var(--ink-3); transition: transform .2s; }
.lt-tr.open .lt-tr-toggle .lp-ico:last-child { transform: rotate(180deg); }
.lt-tr-panel { padding: 0 16px 14px; }
.lt-tr-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); }
.lt-tr-search .lp-ico { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.lt-tr-search input { flex: 1; border: 0; background: transparent; padding: 10px 0; font: inherit; color: var(--ink); outline: none; min-width: 0; }
.lt-tr-search:focus-within { border-color: var(--brand); }
.lt-tr-hint, .lt-tr-none { margin: 8px 2px; font-size: .8rem; color: var(--ink-3); }
.lt-tr-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.lt-tr-list button { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; font: inherit; text-align: left; color: var(--ink-2); cursor: pointer; line-height: 1.45; }
.lt-tr-list button:hover { background: var(--bg); }
.lt-tr-list button.on { background: var(--brand-50); color: var(--ink); }
.lt-tr-t { flex: none; min-width: 3.2em; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand); font-size: .85rem; padding-top: 1px; }
.lt-tr-list mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.lt-resume[hidden], .lt-tr[hidden] { display: none !important; }
