/* Clases & Coaching · Pizarra de Cristal.
   Los tokens viven en ../shared/pizarra.css. Tres escenas con densidades distintas:
   biblioteca y editor (PC, trabajo de preparación) y presentación (pantalla compartida / stream, texto grande). */

:root{ --pres-scale: 1; --topbar-h: 62px; font-family: var(--pz-font); }
body.presenting{ overflow: hidden; }
button{ font-family: inherit; cursor: pointer; }
a{ color: var(--pz-chalk); text-underline-offset: 3px; }
a:hover{ color: #fff; }

.ic{ width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@keyframes pzDraw{ from{ clip-path: inset(0 100% 0 0); } to{ clip-path: inset(0 0 0 0); } }
@keyframes strokeUp{ from{ transform: scaleY(.15); opacity: .3; } to{ transform: scaleY(1); opacity: 1; } }

/* ---------- botones ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--pz-font); padding: 11px 16px; border-radius: var(--pz-radius);
  border: 1px solid var(--pz-line-strong); background: transparent; color: var(--pz-chalk);
  white-space: nowrap; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover{ background: var(--pz-glass-3); border-color: var(--pz-chalk-faint); color: var(--pz-chalk); }
.btn.primary{ background: var(--pz-chalk); border-color: var(--pz-chalk); color: var(--pz-glass); }
.btn.primary:hover{ background: #fff; border-color: #fff; }
.btn.danger{ color: var(--pz-danger); border-color: #6a3a30; }
.btn.danger:hover{ background: rgba(255,122,89,.1); border-color: var(--pz-danger); color: var(--pz-danger); }
.btn.small{ padding: 8px 12px; font-size: 13px; }
.btn:disabled{ opacity: .45; cursor: not-allowed; pointer-events: none; }
.icon-btn{
  width: 34px; height: 34px; border-radius: var(--pz-radius); border: 1px solid transparent; background: transparent;
  color: var(--pz-chalk-dim); display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: background-color .15s, border-color .15s, color .15s;
}
.icon-btn .ic{ width: 17px; height: 17px; }
.icon-btn:hover{ color: var(--pz-chalk); background: var(--pz-glass-3); border-color: var(--pz-line-strong); }
.icon-btn.danger:hover{ color: var(--pz-danger); border-color: #6a3a30; background: rgba(255,122,89,.1); }
.icon-btn:disabled{ opacity: .3; pointer-events: none; }
.link-btn{ background: none; border: none; padding: 0; color: var(--pz-chalk-dim); font: 500 13px var(--pz-font); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover{ color: var(--pz-chalk); }

/* ---------- campos ---------- */
input[type=text], input[type=url], select, textarea{
  width: 100%; background: var(--pz-glass); color: var(--pz-chalk); border: 1px solid var(--pz-line-strong);
  border-radius: var(--pz-radius); padding: 10px 12px; font: 400 15px/1.35 var(--pz-font);
  transition: border-color .15s;
}
input[type=text]::placeholder, textarea::placeholder{ color: var(--pz-chalk-faint); }
input:hover, select:hover, textarea:hover{ border-color: var(--pz-chalk-faint); }
input:focus, select:focus, textarea:focus, .rte:focus{ outline: none; border-color: var(--pz-focus); box-shadow: 0 0 0 1px var(--pz-focus); }
select{
  color-scheme: dark; appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a3aab1' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select option{ background: var(--pz-glass-2); color: var(--pz-chalk); }
textarea{ resize: vertical; line-height: 1.5; }
label.lbl{ display: block; font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); margin: 0 0 6px; }

/* ---------- barra superior ---------- */
header.topbar{ position: sticky; top: 0; z-index: 100; background: var(--pz-glass); border-bottom: 1px solid var(--pz-line-strong); }
.topbar-in{ max-width: 1480px; margin: 0 auto; padding: 12px 32px; min-height: var(--topbar-h); display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; }
.brand{ display: flex; align-items: center; gap: 14px; }
.brand-strokes{ display: inline-flex; gap: 4px; align-items: flex-end; }
.brand-strokes i{ display: block; width: 6px; height: 24px; border-radius: 2px; }
.brand-strokes i:nth-child(1){ background: var(--pz-top); }
.brand-strokes i:nth-child(2){ background: var(--pz-jg); }
.brand-strokes i:nth-child(3){ background: var(--pz-mid); }
.brand-strokes i:nth-child(4){ background: var(--pz-adc); }
.brand-strokes i:nth-child(5){ background: var(--pz-sup); }
.brand-name{ margin: 0; font-size: 26px; font-weight: 700; font-stretch: 75%; letter-spacing: .005em; line-height: 1; white-space: nowrap; }
.team-bar{ display: flex; align-items: center; gap: 8px; font-size: 14px; }
.team-bar label{ font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); white-space: nowrap; }
.team-bar select{ width: auto; max-width: 230px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.top-right{ margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.user-chip{ color: var(--pz-chalk-dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; }
.user-chip b{ color: var(--pz-chalk); font-weight: 600; }
.readonly-badge{ font-size: 13px; font-weight: 600; color: var(--pz-adc); border: 1px solid color-mix(in srgb, var(--pz-adc) 45%, transparent); border-radius: 6px; padding: 4px 10px; }
.sync-indicator{ display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pz-chalk-dim); white-space: nowrap; }
.sync-indicator::before{ content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pz-chalk-faint); }
.sync-indicator[data-state="ok"]::before{ background: var(--pz-jg); }
.sync-indicator[data-state="syncing"]::before{ background: var(--pz-adc); }
.sync-indicator[data-state="off"]::before{ background: var(--pz-top); }

main{ max-width: 1480px; margin: 0 auto; padding: 36px 32px 96px; }

/* ---------- cabeceras de página ---------- */
.lib-head{ display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title{ margin: 0; font-size: 40px; font-weight: 700; font-stretch: 75%; line-height: 1.05; letter-spacing: .005em; text-wrap: balance; }
.page-title .pz-stroke::after{ clip-path: inset(0 0 0 0); animation: pzDraw .7s var(--pz-ease) .2s both; }
.page-sub{ margin: 12px 0 0; color: var(--pz-chalk-dim); font-size: 14px; }

/* ---------- biblioteca ---------- */
.lib-filters{ display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.search{ position: relative; flex: 0 1 360px; min-width: 220px; }
.search .ic{ position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--pz-chalk-faint); pointer-events: none; width: 17px; height: 17px; }
.search input{ padding-left: 40px; }
.chips{ display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 1101px){ .chips{ display: none; } }
.chip{
  font: 600 13px/1 var(--pz-font); padding: 10px 13px; border-radius: var(--pz-radius);
  border: 1px solid var(--pz-line-strong); background: transparent; color: var(--pz-chalk-dim);
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover{ color: var(--pz-chalk); background: var(--pz-glass-3); }
.chip.active{ background: var(--pz-chalk); border-color: var(--pz-chalk); color: var(--pz-glass); }

/* maestro | lista | detalle: un solo panel con tres zonas */
.lib-split{
  display: grid; grid-template-columns: 210px minmax(0, 1fr) 420px;
  border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); background: var(--pz-glass-2); overflow: clip;
}
.lib-split.no-rail{ grid-template-columns: minmax(0, 1fr) 420px; }
.lib-split.no-detail{ grid-template-columns: 210px minmax(0, 1fr); }
.lib-split.no-rail.no-detail{ grid-template-columns: minmax(0, 1fr); }
.lib-cats[hidden]{ display: none; }
.lib-cats{ padding: 14px 10px; border-right: 1px solid var(--pz-line); align-content: start; display: flex; flex-direction: column; gap: 2px; }
.cat{
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline; text-align: left;
  padding: 11px 12px; border-radius: var(--pz-radius); border: 0; background: transparent;
  color: var(--pz-chalk-dim); font: 500 14px/1.2 var(--pz-font); transition: background-color .15s, color .15s;
}
.cat:hover{ color: var(--pz-chalk); background: var(--pz-glass-3); }
.cat.on{ color: var(--pz-chalk); font-weight: 700; background: var(--pz-glass-3); }
.cat-n{ color: var(--pz-chalk-faint); font-size: 13px; font-weight: 500; }
.lib-list{ min-width: 0; border-right: 1px solid var(--pz-line); }
.lib-split.no-detail .lib-list{ border-right: 0; }
.lr{
  display: block; width: 100%; text-align: left; padding: 17px 24px; min-height: 44px;
  border: 0; border-bottom: 1px solid var(--pz-line); background: transparent; color: var(--pz-chalk);
  transition: background-color .15s;
}
.lr:hover{ background: var(--pz-glass-3); }
.lr.on{ background: var(--pz-glass-3); }
.lr.on .lr-title{ text-decoration: underline; text-decoration-color: var(--pz-adc); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.lr-title{ display: block; font-size: 19px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.lr-meta{ display: block; margin-top: 5px; font-size: 13px; color: var(--pz-chalk-dim); }
.lib-none{ padding: 56px 24px; text-align: center; }
.lib-none h3{ margin: 0 0 8px; font-size: 26px; font-weight: 700; font-stretch: 75%; line-height: 1.1; }
.lib-none p{ margin: 0; color: var(--pz-chalk-dim); font-size: 15px; }

.lib-detail{ padding: 24px 26px 28px; min-width: 0; }
.lib-detail:not(.inline) .det{ position: sticky; top: calc(var(--topbar-h) + 32px); }
.lib-detail.inline{ border-bottom: 1px solid var(--pz-line-strong); background: var(--pz-glass); padding: 20px 24px 24px; }
.lib-detail[hidden]{ display: none; }
.det-title{ margin: 0 0 8px; font-size: 30px; font-weight: 700; font-stretch: 75%; line-height: 1.05; text-wrap: balance; }
.det-desc{ margin: 0 0 8px; color: var(--pz-chalk-dim); font-size: 15px; line-height: 1.5; }
.det-facts{ margin: 0; color: var(--pz-chalk-faint); font-size: 13px; }
.det-sec{ margin: 24px 0 8px; font-size: 13px; font-weight: 600; color: var(--pz-chalk-faint); }
.outline{ list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pz-line); }
.outline li{ border-bottom: 1px solid var(--pz-line); }
.ol-item{
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 11px 6px; min-height: 44px; border: 0; background: transparent; color: var(--pz-chalk); font: 500 15px/1.3 var(--pz-font);
  transition: background-color .15s;
}
.ol-item:hover{ background: var(--pz-glass-3); }
.ol-item .n{
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--pz-line-strong); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--pz-chalk-dim);
}
.ol-item.done .n{ background: var(--pz-adc); border-color: var(--pz-adc); color: var(--pz-glass); }
.ol-item .n .ic{ width: 14px; height: 14px; stroke-width: 2.4; }
.det-prog{ margin: 12px 0 0; font-size: 13px; color: var(--pz-chalk-dim); }
.det-act{ display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.kebab{ position: relative; }
.kebab .icon-btn{ width: 42px; height: 42px; border-color: var(--pz-line-strong); }
.menu{
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 6px;
  background: var(--pz-glass-3); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius);
}
.menu[hidden]{ display: none; }
.menu-item{
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; min-height: 44px; border: 0; border-radius: 6px;
  background: transparent; color: var(--pz-chalk); font: 500 14px/1 var(--pz-font); text-align: left;
}
.menu-item:hover{ background: var(--pz-glass-2); }
.menu-item.danger{ color: var(--pz-danger); }
.pill{ display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); white-space: nowrap; }
.pill::before{ content: ""; width: 4px; height: 12px; border-radius: 1px; background: var(--pz-chalk); box-shadow: 7px 0 0 var(--lv2, var(--pz-chalk)); margin-right: 18px; }
.pill.beginner{ --lv2: var(--pz-line-strong); }

.empty{ border: 1px dashed var(--pz-line-strong); border-radius: var(--pz-radius-lg); padding: 60px 24px; text-align: center; }
.empty h3{ margin: 0 0 10px; font-size: 30px; font-weight: 700; font-stretch: 75%; line-height: 1.1; text-wrap: balance; }
.empty p{ margin: 0 auto 22px; max-width: 540px; line-height: 1.55; font-size: 15px; color: var(--pz-chalk-dim); }
.empty .row{ display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- editor ---------- */
.editor-bar{
  position: sticky; top: var(--topbar-h); z-index: 50; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; margin: -12px 0 20px; background: var(--pz-glass); border-bottom: 1px solid var(--pz-line);
}
.editor-bar .spacer{ flex: 1; }
.ed-state{ display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--pz-chalk-dim); }
.ed-state::before{ content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pz-jg); }
.ed-state.dirty{ color: var(--pz-chalk); }
.ed-state.dirty::before{ background: var(--pz-adc); }
.ed-state.new::before{ background: var(--pz-chalk-faint); }
.ed-size{ font-size: 13px; color: var(--pz-chalk-faint); }
.ed-size.high{ color: var(--pz-adc); }
.ed-size.over{ color: var(--pz-danger); font-weight: 700; }
.draft-banner{
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--pz-adc) 45%, transparent); background: color-mix(in srgb, var(--pz-adc) 8%, transparent);
  border-radius: var(--pz-radius); font-size: 14px;
}
.panel{ background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); }
.ed-meta{ padding: 22px; display: grid; grid-template-columns: 2fr 1fr; gap: 16px 20px; margin-bottom: 36px; }
.ed-meta .full{ grid-column: 1 / -1; }
#edTitle{ font-size: 24px; font-weight: 700; font-stretch: 75%; padding: 11px 14px; }
.ed-section-head{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.ed-section-head h2{ margin: 0; flex: 1; font-size: 28px; font-weight: 700; font-stretch: 75%; line-height: 1.1; }

.block-card{ margin-bottom: 10px; overflow: hidden; transition: border-color .15s; }
.block-card.open{ border-color: var(--pz-chalk-faint); }
.bc-head{ display: flex; align-items: center; gap: 14px; padding: 11px 14px; cursor: pointer; user-select: none; transition: background-color .15s; }
.bc-head:hover{ background: var(--pz-glass-3); }
.bc-num{
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--pz-chalk-dim); border: 1px solid var(--pz-line-strong);
}
.block-card.open .bc-num{ background: var(--pz-chalk); border-color: var(--pz-chalk); color: var(--pz-glass); }
.bc-title{ flex: 1; min-width: 0; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-title.empty-title{ color: var(--pz-chalk-faint); font-weight: 400; }
.bc-meta{ font-size: 13px; color: var(--pz-chalk-faint); white-space: nowrap; }
.bc-actions{ display: flex; gap: 2px; }
.bc-caret{ color: var(--pz-chalk-dim); display: inline-flex; transition: transform .2s var(--pz-ease); }
.block-card.open .bc-caret{ transform: rotate(180deg); }
.bc-body{ padding: 22px 22px 24px; border-top: 1px solid var(--pz-line-strong); display: flex; flex-direction: column; gap: 26px; }
.row2{ display: grid; grid-template-columns: 1fr 220px; gap: 16px; }
.rte-toolbar{
  display: flex; gap: 2px; flex-wrap: wrap; align-items: center; padding: 6px; background: var(--pz-glass-3);
  border: 1px solid var(--pz-line-strong); border-bottom: none; border-radius: var(--pz-radius) var(--pz-radius) 0 0;
}
.rte-toolbar button{
  background: transparent; border: 1px solid transparent; color: var(--pz-chalk); min-width: 34px; height: 32px; padding: 0 10px;
  border-radius: 6px; font: 600 13px var(--pz-font); display: inline-flex; align-items: center; gap: 7px; transition: background-color .15s, border-color .15s;
}
.rte-toolbar button:hover{ border-color: var(--pz-line-strong); background: var(--pz-glass); }
.rte-toolbar button[data-fmt="i"]{ font-style: italic; }
.rte-toolbar button[data-fmt="u"]{ text-decoration: underline; text-underline-offset: 3px; }
.rte-toolbar button[data-mark]::before{ content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--mk); }
.rte-toolbar button[data-mark="kc"]{ --mk: var(--pz-adc); }
.rte-toolbar button[data-mark="warn"]{ --mk: var(--pz-top); }
.rte-toolbar button[data-mark="hl"]{ --mk: color-mix(in srgb, var(--pz-adc) 55%, transparent); }
.rte-toolbar .sep{ width: 1px; height: 20px; background: var(--pz-line-strong); margin: 0 5px; }
.rte{
  min-height: 180px; padding: 16px 18px; background: var(--pz-glass); border: 1px solid var(--pz-line-strong);
  border-radius: 0 0 var(--pz-radius) var(--pz-radius); font-size: 16px; line-height: 1.65; overflow-wrap: anywhere;
}
.rte:empty::before{ content: attr(data-placeholder); color: var(--pz-chalk-faint); pointer-events: none; }
.sub-sec h4{ margin: 0 0 4px; font-size: 17px; font-weight: 700; font-stretch: 75%; }
.sub-sec .hint{ margin: 0 0 12px; font-size: 14px; color: var(--pz-chalk-dim); max-width: 80ch; }
.res-list, .ex-list{ display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.res-row{ display: flex; gap: 14px; align-items: center; padding: 8px 10px 8px 8px; background: var(--pz-glass); border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius); }
.res-thumb{ width: 92px; height: 58px; border-radius: 6px; background: var(--pz-glass-3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--pz-chalk-dim); }
.res-thumb .ic{ width: 24px; height: 24px; }
.res-thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.res-thumb img.loading{ opacity: .3; }
.res-main{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.res-kind{ font-size: 13px; font-weight: 700; color: var(--pz-chalk); }
.res-url{ font-size: 13px; color: var(--pz-chalk-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-main input{ padding: 7px 10px; font-size: 14px; }
.res-add{ display: grid; grid-template-columns: 1fr 130px 1fr auto auto; gap: 8px; align-items: center; }
.dropzone-active{ outline: 2px dashed var(--pz-adc); outline-offset: 6px; border-radius: var(--pz-radius); }
.ex-row{ display: grid; grid-template-columns: 220px 1fr auto; gap: 8px; align-items: start; }
.ex-row textarea{ min-height: 44px; }
.notes-box{ padding: 14px 16px 16px; border: 1px dashed var(--pz-chalk-faint); border-radius: var(--pz-radius); }
.notes-box label.lbl{ display: flex; align-items: center; gap: 8px; color: var(--pz-chalk); }
.block-empty{ padding: 36px; text-align: center; color: var(--pz-chalk-dim); border: 1px dashed var(--pz-line-strong); border-radius: var(--pz-radius-lg); margin-bottom: 12px; }

/* ---------- contenido enriquecido (editor + presentación) ---------- */
.rich p{ margin: 0 0 .8em; }
/* el saneador convierte h1/h2 en h3 y h3/h4 en h4: los dos son subtítulos de sección */
.rich h3, .rich h4{ margin: 1.15em 0 .4em; font-size: 1.35em; font-weight: 700; font-stretch: 75%; line-height: 1.15; }
.rich ul, .rich ol{ margin: 0 0 .9em; padding-left: 1.45em; }
.rich li{ margin: .3em 0; }
.rich ul li::marker{ color: var(--pz-adc); }
.rich ol li::marker{ color: var(--pz-chalk-dim); font-weight: 700; }
.rich strong{ font-weight: 700; color: #fff; }
.rich mark{ background: color-mix(in srgb, var(--pz-adc) 32%, transparent); color: inherit; padding: 0 .2em; border-radius: 3px; }
.rich code{ background: var(--pz-glass-3); padding: .08em .4em; border-radius: 4px; font-family: var(--pz-font); font-size: .92em; }
.rich blockquote{ margin: 1em 0; padding: .8em 1.1em; border: 1px solid var(--pz-line-strong); background: var(--pz-glass-2); border-radius: var(--pz-radius); }
.rich blockquote p:last-child{ margin-bottom: 0; }
.rich blockquote.kc{ border-color: color-mix(in srgb, var(--pz-adc) 55%, transparent); }
.rich blockquote.warn{ border-color: color-mix(in srgb, var(--pz-top) 55%, transparent); }
.rich blockquote.kc::before, .rich blockquote.warn::before{
  display: block; width: fit-content; font-size: .7em; font-weight: 700; line-height: 1.3; padding: .25em .7em; border-radius: 4px; margin-bottom: .6em;
}
.rich blockquote.kc::before{ content: "Concepto clave"; color: var(--pz-adc); background: color-mix(in srgb, var(--pz-adc) 16%, transparent); }
.rich blockquote.warn::before{ content: "Error común"; color: var(--pz-top); background: color-mix(in srgb, var(--pz-top) 16%, transparent); }

/* ---------- presentación ---------- */
.pres{ position: fixed; inset: 0; z-index: 1000; display: flex; background: var(--pz-glass); }
.pres-side{ width: 330px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--pz-glass-2); border-right: 1px solid var(--pz-line-strong); transition: margin-left .25s var(--pz-ease); }
.pres.side-hidden .pres-side{ margin-left: -330px; }
.side-head{ padding: 24px 20px 18px; border-bottom: 1px solid var(--pz-line-strong); }
.side-title{ font-size: 24px; font-weight: 700; font-stretch: 75%; line-height: 1.12; text-wrap: balance; }
.side-cat{ margin: 6px 0 16px; font-size: 14px; color: var(--pz-chalk-dim); }
.progress{ height: 6px; background: var(--pz-line); border-radius: 3px; overflow: hidden; }
.progress-bar{ height: 100%; width: 0; background: var(--pz-adc); border-radius: 3px; transition: width .4s var(--pz-ease); }
.progress-meta{ display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: var(--pz-chalk-dim); }
.side-list{ list-style: none; margin: 0; padding: 10px 8px 96px; overflow-y: auto; flex: 1; }
.side-item{ display: flex; align-items: stretch; margin-bottom: 2px; border-radius: var(--pz-radius); transition: background-color .15s; }
.side-item:hover, .side-item.active{ background: var(--pz-glass-3); }
.si-check{ width: 48px; flex-shrink: 0; background: none; border: none; display: flex; align-items: center; justify-content: center; padding: 0; color: var(--pz-chalk-dim); }
.si-check span{
  width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; border: 1.5px solid var(--pz-line-strong); transition: background-color .15s, border-color .15s, color .15s;
}
.si-check .ic{ width: 15px; height: 15px; stroke-width: 2.4; }
.si-check:hover span{ border-color: var(--pz-chalk); color: var(--pz-chalk); }
.side-item.covered .si-check span{ background: var(--pz-adc); border-color: var(--pz-adc); color: var(--pz-glass); }
.side-item.active:not(.covered) .si-check span{ border-color: var(--pz-chalk); color: var(--pz-chalk); }
.si-main{ flex: 1; min-width: 0; background: none; border: none; text-align: left; padding: 11px 10px 11px 0; color: var(--pz-chalk-dim); font: 500 15px/1.35 var(--pz-font); }
.si-main:hover{ color: var(--pz-chalk); }
.side-item.active .si-main{ color: var(--pz-chalk); font-weight: 700; }
.si-main .pill{ margin-top: 5px; font-size: 12px; }
.pres-canvas{ flex: 1; overflow-y: auto; outline: none; scroll-behavior: smooth; }
.pres-article{ max-width: 1080px; margin: 0 auto; padding: 56px 48px 160px; }
.pa-title{
  margin: 0 0 16px; font-size: calc(58px * var(--pres-scale)); font-weight: 700; font-stretch: 75%;
  letter-spacing: .005em; line-height: 1.04; text-wrap: balance; position: relative; padding-bottom: 20px;
}
.pa-title::after{
  content: ""; position: absolute; left: -2px; bottom: 0; width: min(260px, 60%); height: 10px; background: var(--pz-adc);
  -webkit-mask: var(--pz-stroke-mask) 0 0 / 100% 100% no-repeat; mask: var(--pz-stroke-mask) 0 0 / 100% 100% no-repeat;
  animation: pzDraw .7s var(--pz-ease) .1s both;
}
.pa-status{ display: flex; align-items: center; gap: 22px; margin: 0 0 30px; font-size: calc(15px * var(--pres-scale)); color: var(--pz-chalk-dim); min-height: 1.5em; }
.pa-status .done{ display: inline-flex; align-items: center; gap: 8px; color: var(--pz-chalk); font-weight: 600; }
.pa-status .done::before{ content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--pz-adc); }
.pa-body{ font-size: calc(23px * var(--pres-scale)); line-height: 1.62; color: var(--pz-chalk); max-width: 62ch; }
.pa-media{ display: flex; flex-direction: column; gap: 30px; margin: 40px 0; }
.pa-fig{ margin: 0; }
.pa-fig img{
  display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: var(--pz-radius-lg); cursor: zoom-in;
  border: 1px solid var(--pz-line-strong); background: var(--pz-glass-2); transition: border-color .15s;
}
.pa-fig img:hover{ border-color: var(--pz-chalk-faint); }
.pa-fig img.loading{ min-height: 180px; opacity: .35; }
.draw-host{ position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; }
.draw-expand{
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); color: var(--pz-chalk); opacity: 0; transition: opacity .15s, border-color .15s;
}
.draw-expand .ic{ width: 19px; height: 19px; }
.draw-host:hover .draw-expand, .draw-expand:focus-visible{ opacity: 1; }
.draw-expand:hover{ border-color: var(--pz-chalk); }
/* Descripción del recurso: etiqueta destacada bajo la imagen o el clip */
.pa-cap{
  display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 13px 20px; border-radius: var(--pz-radius);
  background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong);
  font-weight: 700; font-stretch: 85%; line-height: 1.3; color: var(--pz-chalk); font-size: calc(26px * var(--pres-scale));
}
.pa-cap::before{ content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--pz-adc); flex-shrink: 0; }
/* capa de dibujo (lápiz) */
.draw-layer{ position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; touch-action: none; }
.pres.drawing .draw-layer{ pointer-events: auto; cursor: crosshair; }
.pres.drawing.tool-eraser .draw-layer{ cursor: cell; }
.pres.drawing .pa-fig img{ cursor: crosshair; }
.draw-palette{
  position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; width: max-content; max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center;
  background: var(--pz-glass-2); border: 1px solid var(--pz-chalk-faint); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.draw-palette .sep{ width: 1px; height: 24px; background: var(--pz-line-strong); margin: 0 6px; }
.dp-color{ width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--pz-glass-2); padding: 0; box-shadow: 0 0 0 1.5px transparent; transition: box-shadow .15s, transform .15s; }
.dp-color:hover{ transform: scale(1.1); }
.dp-color.on{ box-shadow: 0 0 0 2px var(--pz-chalk); }
.dp-size{ width: 36px; height: 36px; border-radius: 10px; background: transparent; border: 1px solid transparent; display: flex; align-items: center; justify-content: center; padding: 0; }
.dp-size i{ display: block; border-radius: 50%; background: var(--pz-chalk); }
.dp-size:hover{ background: var(--pz-glass-3); }
.dp-size.on{ border-color: var(--pz-chalk-faint); background: var(--pz-glass-3); }
.dp-btn{ min-width: 36px; height: 36px; font-size: 13px; padding: 0 11px; }
.video-frame{ position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--pz-radius-lg); overflow: hidden; border: 1px solid var(--pz-line-strong); background: #000; }
.video-frame iframe, .video-frame video{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.link-card{
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg);
  background: var(--pz-glass-2); color: var(--pz-chalk); text-decoration: none; transition: border-color .15s, background-color .15s;
}
a.link-card:hover{ border-color: var(--pz-chalk-faint); background: var(--pz-glass-3); }
.link-card .ico{ display: inline-flex; color: var(--pz-chalk-dim); }
.link-card .ico .ic{ width: 26px; height: 26px; }
.link-card .lc-title{ font-weight: 600; font-size: calc(18px * var(--pres-scale)); }
.link-card .lc-url{ font-size: 13px; color: var(--pz-chalk-dim); word-break: break-all; }
.pa-exercises{ margin-top: 44px; padding: 24px 28px 18px; border: 1px solid var(--pz-line-strong); border-radius: var(--pz-radius-lg); background: var(--pz-glass-2); max-width: 62ch; }
.pa-exercises h2{ margin: 0 0 8px; font-size: calc(30px * var(--pres-scale)); font-weight: 700; font-stretch: 75%; line-height: 1.1; }
.ex-item{ display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--pz-line); font-size: calc(20px * var(--pres-scale)); line-height: 1.5; cursor: pointer; }
.ex-item:first-of-type{ border-top: none; }
.ex-item input{
  appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 2px 0 0; flex-shrink: 0; border: 2px solid var(--pz-chalk-faint);
  border-radius: 7px; background: transparent; cursor: pointer; display: grid; place-content: center; padding: 0; transition: background-color .15s, border-color .15s;
}
.ex-item input:hover{ border-color: var(--pz-chalk); }
.ex-item input:checked{ background: var(--pz-adc); border-color: var(--pz-adc); }
.ex-item input:checked::after{ content: ""; width: 18px; height: 18px; background: var(--pz-glass); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M5 12.5l4.5 4.5L19 7.5%27 fill=%27none%27 stroke=%27black%27 stroke-width=%273.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M5 12.5l4.5 4.5L19 7.5%27 fill=%27none%27 stroke=%27black%27 stroke-width=%273.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E") center / contain no-repeat; }
.ex-item.checked .ex-text{ text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--pz-chalk-faint); }
.ex-kind{ display: block; font-weight: 700; font-size: .7em; color: var(--pz-chalk-dim); margin-bottom: 3px; }
.pres-controls{
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 2px;
  padding: 6px; max-width: calc(100vw - 24px); background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.pres-controls .sep{ width: 1px; height: 24px; background: var(--pz-line-strong); margin: 0 6px; }
.pc-btn{
  background: transparent; border: 1px solid transparent; color: var(--pz-chalk); min-width: 40px; height: 40px; border-radius: 10px; padding: 0 12px;
  font: 600 14px var(--pz-font); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color .15s, border-color .15s, color .15s;
}
.pc-btn .ic{ width: 20px; height: 20px; }
.pc-btn:hover{ background: var(--pz-glass-3); }
.pc-btn.on{ color: var(--pz-adc); background: color-mix(in srgb, var(--pz-adc) 13%, transparent); border-color: color-mix(in srgb, var(--pz-adc) 40%, transparent); }
.pc-btn:disabled{ opacity: .3; pointer-events: none; }
.pc-count{ font-weight: 700; font-size: 16px; min-width: 70px; text-align: center; letter-spacing: .02em; }
.notes-panel{
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); z-index: 15; display: flex; flex-direction: column; gap: 12px;
  padding: 22px 20px 104px; background: var(--pz-glass-2); border-left: 1px solid var(--pz-chalk-faint); overflow-y: auto;
  box-shadow: -16px 0 40px rgba(0,0,0,.45);
}
/* con las notas abiertas el contenido se estrecha en vez de quedar tapado (en pantallas chicas se superponen) */
@media (min-width: 901px){ .pres.notes-open .pres-canvas{ margin-right: min(420px, 92vw); } }
.notes-panel h3{ margin: 0; display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; font-stretch: 75%; }
.notes-panel h3 .x{ margin-left: auto; }
.notes-panel .sub{ font-size: 13px; line-height: 1.5; color: var(--pz-chalk-dim); margin: 0 0 4px; }
.notes-panel textarea{ min-height: 190px; font-size: 16px; }
.notes-panel textarea.general{ min-height: 110px; }
.notes-status{ font-size: 13px; color: var(--pz-chalk-faint); min-height: 18px; }
.notes-msg{ font-size: 14px; color: var(--pz-chalk-dim); line-height: 1.5; }
.lightbox{ position: absolute; inset: 0; z-index: 50; background: var(--pz-glass); display: flex; flex-direction: column; }
.lb-stage{ flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; touch-action: none; }
.lb-frame{ position: relative; display: inline-block; line-height: 0; transform-origin: center; will-change: transform; }
.lb-stage img{ display: block; max-width: 96vw; max-height: 82vh; user-select: none; -webkit-user-drag: none; }
.lb-cap{
  align-self: center; margin: 6px 20px 22px; padding: 12px 22px; max-width: min(1100px, 92vw); border-radius: var(--pz-radius); text-align: center;
  background: var(--pz-glass-2); border: 1px solid var(--pz-line-strong); font-weight: 700; font-stretch: 85%; font-size: 24px; line-height: 1.3;
}
.lb-cap:empty{ display: none; }
.lb-tools{ position: absolute; top: 14px; right: 16px; display: flex; gap: 6px; z-index: 2; }
.lb-tools .pc-btn, .lb-nav{ background: var(--pz-glass-2); border-color: var(--pz-line-strong); }
.lb-tools .pc-btn:hover, .lb-nav:hover{ background: var(--pz-glass-3); border-color: var(--pz-chalk-faint); }
.lb-nav{ position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 76px; border-radius: 12px; }
.lb-nav .ic{ width: 26px; height: 26px; }
.lb-nav.prev{ left: 14px; } .lb-nav.next{ right: 14px; }
.lb-count{ position: absolute; top: 24px; left: 22px; font-weight: 700; letter-spacing: .02em; color: var(--pz-chalk-dim); z-index: 2; }
.help-overlay{ position: absolute; inset: 0; z-index: 40; background: rgba(13,15,18,.86); display: flex; align-items: center; justify-content: center; padding: 20px; }
.help-box{ padding: 28px 32px; max-width: 540px; width: 100%; }
.help-box h3{ margin: 0 0 18px; font-size: 28px; font-weight: 700; font-stretch: 75%; line-height: 1.1; }
.help-box dl{ display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0 0 20px; font-size: 14px; align-items: baseline; }
.help-box dt{ white-space: nowrap; }
.help-box dd{ margin: 0; color: var(--pz-chalk-dim); }
kbd{ font: 600 13px var(--pz-font); background: var(--pz-glass-3); border: 1px solid var(--pz-line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 8px; }

/* ---------- aviso y pantalla de carga ---------- */
#toast{
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(14px); z-index: 3000; opacity: 0; pointer-events: none;
  background: var(--pz-glass-3); border: 1px solid var(--pz-chalk-faint); color: var(--pz-chalk); padding: 12px 20px; border-radius: var(--pz-radius);
  font-size: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5); transition: opacity .25s, transform .25s var(--pz-ease); max-width: min(560px, 92vw); text-align: center;
}
#toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }
#loadingVeil{ position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; background: var(--pz-glass); transition: opacity .28s ease; }
#loadingVeil.is-leaving{ opacity: 0; pointer-events: none; }
#loadingVeil .loading-mark{ display: flex; align-items: center; gap: 14px; }
#loadingVeil .brand-strokes i{ width: 8px; height: 34px; animation: strokeUp .7s var(--pz-ease) both; transform-origin: bottom; }
#loadingVeil .brand-strokes i:nth-child(2){ animation-delay: .08s; }
#loadingVeil .brand-strokes i:nth-child(3){ animation-delay: .16s; }
#loadingVeil .brand-strokes i:nth-child(4){ animation-delay: .24s; }
#loadingVeil .brand-strokes i:nth-child(5){ animation-delay: .32s; }
#loadingVeil .loading-text{ font-size: 38px; font-weight: 800; font-stretch: 62%; letter-spacing: .03em; line-height: 1; }

@media (max-width: 1100px){
  .lib-split, .lib-split.no-rail, .lib-split.no-detail{ grid-template-columns: minmax(0, 1fr); }
  .lib-cats{ display: none; }
  .lib-list{ border-right: 0; }
}
@media (max-width: 900px){
  main{ padding: 24px 16px 80px; }
  .topbar-in{ padding: 12px 16px; }
  .top-right{ margin-left: 0; }
  .page-title{ font-size: 32px; }
  .lr{ padding: 16px; }
  .lib-detail.inline{ padding: 18px 16px 22px; }
  .det-title{ font-size: 26px; }
  .ed-meta, .row2{ grid-template-columns: 1fr; }
  .res-add{ grid-template-columns: 1fr 1fr; }
  .ex-row{ grid-template-columns: 1fr auto; }
  .ex-row select{ grid-column: 1 / -1; }
  .bc-meta{ display: none; }
  .pres-side{ position: absolute; inset: 0 auto 0 0; z-index: 30; }
  .pres-article{ padding: 34px 20px 160px; }
  .pa-title{ font-size: calc(36px * var(--pres-scale)); }
  .pa-body{ font-size: calc(20px * var(--pres-scale)); }
  .pc-btn .lbl{ display: none; }
  .editor-bar{ top: 0; position: static; margin-top: 0; }
}
