/* ══════════════════════════════════════════════════════════
   COMPONENTS — Macro Procesos UPV
   Slide layouts: portada, intro, mapa, chapter, process
   ══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   PORTADA
───────────────────────────────────────────── */
.slide-portada {
  background: var(--grey-upv-dark) !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 72px !important;
  gap: 0 !important;
}

.portada-eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.portada-title {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin: 0 0 8px;
}

.portada-title span {
  color: var(--red);
}

.portada-sub {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--grey-medium);
  margin: 16px 0 36px;
}

.portada-divider {
  width: 60px;
  height: 4px;
  background: var(--red-dark);
  border-radius: 2px;
  margin-bottom: 36px;
}

.portada-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 760px;
}

.portada-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: all var(--ease);
  border: 1.5px solid rgba(255,255,255,0.15);
}

.portada-chip:hover {
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.portada-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

/* ─────────────────────────────────────────────
   INTRO TEXT (Slide 2)
───────────────────────────────────────────── */
.slide-intro-text {
  background: var(--white) !important;
  max-width: 800px;
  margin: 0 auto;
  align-self: center;
  width: 100%;
}

.intro-header {
  border-left: 4px solid var(--red-dark);
  padding-left: 16px;
  margin-bottom: 24px;
}

.intro-header h2 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 700;
  color: var(--grey-upv-dark);
  margin: 0;
}

.intro-body p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-upv);
  margin: 0 0 14px;
}

.intro-quote {
  margin-top: 24px;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  background: var(--grey-light);
  border-left: 4px solid var(--red-dark);
  font-family: var(--font-head);
  font-size: 16px;
  font-style: italic;
  font-weight: 500;
  color: var(--grey-upv-dark);
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   MAPA (Slide 3)
───────────────────────────────────────────── */
.slide-mapa {
  padding: 20px 24px !important;
}

.mapa-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--grey-upv-dark);
  margin-bottom: 16px;
  border-left: 4px solid var(--grey-upv);
  padding-left: 12px;
}

.mapa-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.mapa-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--ch-color);
  cursor: pointer;
  transition: all var(--ease);
}

.mapa-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.mapa-card-title {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-upv-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.mapa-card-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mapa-card-item {
  font-size: 10.5px;
  color: var(--grey-dark);
  padding: 2px 0;
  border-left: 2px solid var(--grey-light);
  padding-left: 6px;
  line-height: 1.3;
}

/* ─────────────────────────────────────────────
   CHAPTER INTRO SLIDE
───────────────────────────────────────────── */
.slide-chapter-intro {
  gap: 16px !important;
}

.chapter-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  background: var(--ch-color);
  color: var(--white);
}

.chapter-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.chapter-header-text { flex: 1; }

.chapter-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
  font-family: var(--font-body);
}

.chapter-header h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 700;
  margin: 2px 0 0;
  color: var(--white);
}

.chapter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ch-block {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.ch-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--ch-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grey-light);
}

.ch-block-icon {
  width: 22px; height: 22px;
  background: var(--ch-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ch-color);
  flex-shrink: 0;
}

.ch-block p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--grey-upv);
  margin: 0 0 8px;
}

.ch-block ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ch-block li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--grey-upv);
  padding-left: 14px;
  position: relative;
}

.ch-block li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--ch-color);
  font-weight: 700;
}

.ch-block li.question::before {
  content: '*';
  font-size: 11px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  background: var(--ch-light);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ch-color);
  left: 0;
  top: 1px;
}

/* ─────────────────────────────────────────────
   PROCESS SLIDE (sub-proceso)
───────────────────────────────────────────── */
.slide-process {
  gap: 16px !important;
}

.process-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.process-header > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.process-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  background: var(--ch-color);
  white-space: nowrap;
  flex-shrink: 0;
}

.process-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  font-weight: 700;
  color: var(--grey-upv-dark);
  margin: 0;
  line-height: 1.15;
}

.process-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.process-block {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid transparent;
}

.process-block.estado { border-top-color: var(--ch-color); }
.process-block.mejora { border-top-color: var(--teal-darkest); }

.process-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grey-light);
}

.estado .process-block-title { color: var(--ch-color); }
.mejora .process-block-title { color: var(--teal-darkest); }

.process-block-title i {
  font-size: 13px;
}

.process-block p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--grey-upv);
  margin: 0 0 10px;
}

.process-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.process-block li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--grey-upv);
  padding: 7px 12px 7px 14px;
  border-radius: var(--radius-sm);
  position: relative;
}

.estado li {
  background: var(--grey-bg);
  border-left: 3px solid var(--grey-light);
}

.mejora li {
  background: #f0fdf8;
  border-left: 3px solid var(--teal-darkest);
  font-style: italic;
  color: var(--grey-upv-dark);
}

.mejora li::before {
  content: '¿';
  color: var(--teal-darkest);
  font-weight: 700;
  font-style: normal;
}

/* ─────────────────────────────────────────────
   SINGLE COLUMN PROCESS (when body is simple)
───────────────────────────────────────────── */
.process-body.single {
  grid-template-columns: 1fr;
}

/* ─────────────────────────────────────────────
   IMAGE CARD (dentro del grid de proceso)
───────────────────────────────────────────── */
.process-block.imagenes {
  border-top-color: var(--grey-medium);
}

.process-block.imagenes .process-block-title {
  color: var(--grey-upv);
}

.image-card-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
}

.image-card-item {
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-light);
  background: var(--grey-bg);
  cursor: zoom-in;
  transition: all var(--ease);
  max-width: 100%;
}

.image-card-item:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
  z-index: 2;
  position: relative;
}

.image-card-item img {
  display: block;
  max-height: 200px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

/* Lightbox al hacer clic */
.image-card-item.expanded {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.82);
  border-radius: 0;
  cursor: zoom-out;
  max-width: none;
  transform: none;
  box-shadow: none;
  border: none;
}

.image-card-item.expanded img {
  max-height: 88vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ─────────────────────────────────────────────
   IMAGE BLOCK (legado, por si se reutiliza)
───────────────────────────────────────────── */
.slide-images {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.slide-img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  object-fit: contain;
}

/* ─────────────────────────────────────────────
   RESOURCES PANEL (future use)
───────────────────────────────────────────── */
.resources-panel {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--yellow-dark);
}

.resources-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow-dark);
  margin-bottom: 10px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--grey-light);
  font-size: 13px;
  color: var(--grey-upv);
  text-decoration: none;
  transition: color var(--ease);
}

.resource-item:last-child { border-bottom: none; }
.resource-item:hover { color: var(--red-dark); }

.resource-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.resource-icon.pdf   { background: #fdecea; color: var(--red-darkest); }
.resource-icon.xlsx  { background: #e8f5e9; color: #1b5e20; }
.resource-icon.video { background: #e3f2fd; color: #0d47a1; }
.resource-icon.link  { background: var(--grey-light); color: var(--grey-upv); }
.resource-icon.iframe { background: #f3e5f5; color: #4a148c; }

/* ─────────────────────────────────────────────
   FEEDBACK — Botón flotante + Modal
───────────────────────────────────────────── */

/* Botón flotante */
#feedback-btn {
  position: fixed;
  bottom: calc(var(--footer-h) + 14px);
  right: 20px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--ch-color, var(--red-dark));
  color: var(--white);
  border: none;
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  transition: all var(--ease);
  user-select: none;
}

#feedback-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  filter: brightness(1.08);
}

#feedback-btn i { font-size: 14px; }

/* Overlay */
#feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}

#feedback-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Modal */
#feedback-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: min(540px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--ease);
}

#feedback-overlay.open #feedback-modal {
  transform: translateY(0) scale(1);
}

.fb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 2px solid var(--grey-light);
  background: var(--ch-light, #fdecea);
}

.fb-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  color: var(--grey-upv-dark);
}

.fb-modal-title i {
  color: var(--ch-color, var(--red-dark));
  font-size: 18px;
}

.fb-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--grey-dark);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--ease);
  line-height: 1;
}
.fb-modal-close:hover { background: var(--grey-light); color: var(--grey-upv-dark); }

.fb-modal-context {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 22px;
  background: var(--grey-bg);
  border-bottom: 1px solid var(--grey-light);
}

.fb-context-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ch-light, #fdecea);
  color: var(--ch-color, var(--red-dark));
  border: 1px solid var(--ch-color, var(--red-dark));
  opacity: 0.85;
}

.fb-modal-body {
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fb-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fb-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-upv-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fb-label span { color: var(--red-dark); }

.fb-input,
.fb-select,
.fb-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--grey-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--grey-darkest);
  background: var(--white);
  transition: border-color var(--ease);
  box-sizing: border-box;
}

.fb-input:focus,
.fb-select:focus,
.fb-textarea:focus {
  outline: none;
  border-color: var(--ch-color, var(--red-dark));
  box-shadow: 0 0 0 3px rgba(215,51,51,0.1);
}

.fb-textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.55;
}

.fb-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--grey-light);
  background: var(--grey-bg);
}

.fb-btn-cancel {
  padding: 9px 18px;
  border: 1.5px solid var(--grey-medium);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-upv);
  cursor: pointer;
  transition: all var(--ease);
}
.fb-btn-cancel:hover { border-color: var(--grey-upv); color: var(--grey-upv-dark); }

.fb-btn-send {
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--ch-color, var(--red-dark));
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  transition: all var(--ease);
  display: flex;
  align-items: center;
  gap: 7px;
}
.fb-btn-send:hover { filter: brightness(1.1); }
.fb-btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Toast confirmación */
#fb-toast {
  position: fixed;
  bottom: calc(var(--footer-h) + 70px);
  right: 20px;
  z-index: 500;
  background: #2E7D32;
  color: var(--white);
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transform: translateY(10px);
  opacity: 0;
  transition: all var(--ease);
  pointer-events: none;
}

#fb-toast.show {
  opacity: 1;
  transform: translateY(0);
}

#fb-toast.error {
  background: var(--red-darkest);
}

/* ─────────────────────────────────────────────
   PANEL DE LINKS (esquina inferior derecha)
───────────────────────────────────────────── */

#links-panel {
  position: fixed;
  bottom: calc(var(--footer-h) + 14px);
  right: 100px;           /* deja espacio al botón de feedback */
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Botón toggle del panel */
#links-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  background: var(--white);
  color: var(--grey-upv);
  border: 1.5px solid var(--grey-medium);
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--ease);
  user-select: none;
  white-space: nowrap;
}

#links-toggle:hover {
  border-color: var(--ch-color);
  color: var(--ch-color);
  box-shadow: var(--shadow-lg);
}

#links-toggle.has-links {
  border-color: var(--ch-color);
  color: var(--ch-color);
}

.links-toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  background: var(--ch-color);
  color: var(--white);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
}

/* Caja expandida */
#links-box {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 300px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.95) translateY(6px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--ease);
}

#links-box.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Tabs */
.links-tabs {
  display: flex;
  border-bottom: 1px solid var(--grey-light);
  flex-shrink: 0;
}

.links-tab {
  flex: 1;
  padding: 10px 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--grey-dark);
  border-bottom: 2px solid transparent;
  transition: all var(--ease);
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.links-tab:hover { color: var(--grey-upv-dark); background: var(--grey-bg); }
.links-tab.active {
  color: var(--ch-color);
  border-bottom-color: var(--ch-color);
  background: var(--ch-light);
}

.links-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px;
  background: var(--ch-color);
  color: var(--white);
  border-radius: 8px;
  font-size: 9px; font-weight: 700;
  padding: 0 3px;
}

/* Lista de links */
.links-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
}

.link-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background var(--ease);
  position: relative;
}

.link-item:hover { background: var(--grey-bg); }

.link-item-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.link-item-icon.ext-link   { background: #e3f2fd; color: #0d47a1; }
.link-item-icon.ext-pdf    { background: #fdecea; color: var(--red-darkest); }
.link-item-icon.ext-video  { background: #fce4ec; color: #880e4f; }
.link-item-icon.ext-xlsx   { background: #e8f5e9; color: #1b5e20; }
.link-item-icon.ext-iframe { background: #f3e5f5; color: #4a148c; }
.link-item-icon.int        { background: var(--ch-light); color: var(--ch-color); }

.link-item-text { flex: 1; min-width: 0; }

.link-item-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-upv-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-item-meta {
  font-size: 11px;
  color: var(--grey-dark);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-item-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--grey-dark);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 3px;
  transition: all var(--ease);
  flex-shrink: 0;
}
.link-item:hover .link-item-delete { opacity: 1; }
.link-item-delete:hover { background: #fdecea; color: var(--red-darkest); }

/* Botón añadir */
.links-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px 10px 10px;
  padding: 8px;
  border: 1.5px dashed var(--grey-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-dark);
  cursor: pointer;
  transition: all var(--ease);
  background: none;
  flex-shrink: 0;
}
.links-add-btn:hover {
  border-color: var(--ch-color);
  color: var(--ch-color);
  background: var(--ch-light);
}

/* Estado vacío */
.links-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--grey-dark);
  font-size: 12.5px;
}
.links-empty i { display: block; font-size: 24px; color: var(--grey-medium); margin-bottom: 8px; }

/* ─────────────────────────────────────────────
   MODAL LINK INTERNO (relación + navegación)
───────────────────────────────────────────── */
#intlink-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 450;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ease);
}
#intlink-overlay.open { opacity: 1; pointer-events: all; }

#intlink-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: min(480px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  transform: translateY(14px) scale(0.98);
  transition: transform var(--ease);
}
#intlink-overlay.open #intlink-modal { transform: none; }

.intlink-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--grey-light);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}

.intlink-header-info { flex: 1; }

.intlink-from-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--grey-dark); margin-bottom: 4px;
}

.intlink-arrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--grey-dark);
  margin-bottom: 8px;
}

.intlink-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  background: var(--ch-light); color: var(--ch-color);
  border: 1px solid var(--ch-color);
}

.intlink-target-name {
  font-family: var(--font-head);
  font-size: 17px; font-weight: 700;
  color: var(--grey-upv-dark); margin: 0;
}

.intlink-close {
  background: none; border: none;
  font-size: 16px; color: var(--grey-dark);
  cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--ease); line-height: 1; flex-shrink: 0;
}
.intlink-close:hover { background: var(--grey-light); }

.intlink-body {
  padding: 18px 22px;
}

.intlink-relacion-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--grey-dark); margin-bottom: 8px;
}

.intlink-relacion-text {
  font-size: 14px; line-height: 1.65;
  color: var(--grey-upv);
  background: var(--grey-bg);
  border-left: 3px solid var(--ch-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  font-style: italic;
}

.intlink-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--grey-light);
  display: flex; justify-content: flex-end; gap: 10px;
}

.intlink-btn-cancel {
  padding: 9px 16px;
  border: 1.5px solid var(--grey-medium);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--grey-upv); cursor: pointer;
  transition: all var(--ease);
}
.intlink-btn-cancel:hover { border-color: var(--grey-upv); }

.intlink-btn-go {
  padding: 9px 20px;
  border: none; border-radius: var(--radius-sm);
  background: var(--ch-color);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--white); cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: filter var(--ease);
}
.intlink-btn-go:hover { filter: brightness(1.1); }

/* ─────────────────────────────────────────────
   MODAL AÑADIR LINK
───────────────────────────────────────────── */
#addlink-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 450;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ease);
}
#addlink-overlay.open { opacity: 1; pointer-events: all; }

#addlink-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: min(500px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  transform: translateY(14px) scale(0.98);
  transition: transform var(--ease);
}
#addlink-overlay.open #addlink-modal { transform: none; }

.addlink-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--grey-light);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ch-light);
}

.addlink-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 600;
  color: var(--grey-upv-dark);
  display: flex; align-items: center; gap: 8px;
}
.addlink-title i { color: var(--ch-color); }

.addlink-close {
  background: none; border: none; font-size: 16px; color: var(--grey-dark);
  cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm);
  transition: all var(--ease); line-height: 1;
}
.addlink-close:hover { background: rgba(0,0,0,0.06); }

.addlink-body {
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 13px;
}

.addlink-field { display: flex; flex-direction: column; gap: 5px; }

.addlink-label {
  font-size: 12px; font-weight: 600;
  color: var(--grey-upv-dark);
  text-transform: uppercase; letter-spacing: .04em;
}
.addlink-label span { color: var(--red-dark); }

.addlink-input, .addlink-select, .addlink-textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--grey-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 14px;
  color: var(--grey-darkest); background: var(--white);
  transition: border-color var(--ease);
}
.addlink-input:focus, .addlink-select:focus, .addlink-textarea:focus {
  outline: none; border-color: var(--ch-color);
  box-shadow: 0 0 0 3px rgba(215,51,51,0.08);
}
.addlink-textarea { resize: vertical; min-height: 72px; line-height: 1.55; }

.addlink-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--grey-light);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--grey-bg);
}

.addlink-btn-cancel {
  padding: 8px 16px; border: 1.5px solid var(--grey-medium);
  border-radius: var(--radius-sm); background: var(--white);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--grey-upv); cursor: pointer; transition: all var(--ease);
}
.addlink-btn-cancel:hover { border-color: var(--grey-upv); }

.addlink-btn-save {
  padding: 8px 20px; border: none; border-radius: var(--radius-sm);
  background: var(--ch-color); font-family: var(--font-body);
  font-size: 13px; font-weight: 600; color: var(--white);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: filter var(--ease);
}
.addlink-btn-save:hover { filter: brightness(1.1); }
.addlink-btn-save:disabled { opacity: .5; cursor: not-allowed; }

/* ─────────────────────────────────────────────
   CARDS OBJETIVOS / RETOS / SIRVE
   (se insertan en la parte superior de cada slide
   de tipo process e intro)
───────────────────────────────────────────── */
.obj-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

/* En pantallas medianas: 1+2 columnas */
@media (max-width: 900px) {
  .obj-cards { grid-template-columns: 1fr 1fr; }
  .obj-card--sirve { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .obj-cards { grid-template-columns: 1fr; }
  .obj-card--sirve { grid-column: auto; }
}

.obj-card {
  background: var(--white);
  border: 1.5px solid var(--grey-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow var(--ease), border-color var(--ease);
  min-height: 0;
}

.obj-card:hover {
  border-color: var(--ch-color);
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* Línea de color izquierda */
.obj-card--objetivo { border-left: 4px solid var(--ch-color); }
.obj-card--retos    { border-left: 4px solid #1565C0; }
.obj-card--sirve    { border-left: 4px solid #2E7D32; }

/* Cabecera de la card */
.obj-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
}

.obj-card-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.obj-card--objetivo .obj-card-icon { background: var(--ch-light); color: var(--ch-color); }
.obj-card--retos    .obj-card-icon { background: #e3f2fd;          color: #1565C0; }
.obj-card--sirve    .obj-card-icon { background: #e8f5e9;          color: #2E7D32; }

.obj-card-title {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--grey-dark);
}

/* Contenido */
.obj-card-body {
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--grey-upv);
}

/* Retos: lista de puntos */
.obj-reto-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.obj-reto-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--grey-upv);
}
.obj-reto-item::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #1565C0;
  margin-top: 5px;
  flex-shrink: 0;
}

/* SIRVE: chips por meta */
.obj-sirve-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.obj-sirve-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--grey-upv);
}
.obj-sirve-meta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
/* Colores por meta */
.sirve-meta--Sostenible  { background: #e0f2f1; color: #004D40; }
.sirve-meta--Internacional { background: #e8eaf6; color: #283593; }
.sirve-meta--Relevante   { background: #fce4ec; color: #880E4F; }
.sirve-meta--Vital       { background: #fff8e1; color: #E65100; }
.sirve-meta--Excelente   { background: #f3e5f5; color: #4A148C; }


/* ════════════════════════════════════════════════════════════
   OBJECTIVES EDITOR — Toolbar, toggles, edit mode, modal
   ════════════════════════════════════════════════════════════ */

/* ── Auto-fit grid: se ajusta sola cuando se ocultan cards ── */
.obj-cards {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ── Ocultar cards individualmente ──────────────────────────  */
body.hide-obj-objetivo .obj-card--objetivo { display: none; }
body.hide-obj-retos    .obj-card--retos    { display: none; }
body.hide-obj-sirve    .obj-card--sirve    { display: none; }
/* Si todas están ocultas, eliminar el espacio del contenedor */
body.hide-obj-objetivo.hide-obj-retos.hide-obj-sirve .obj-cards { display: none; }

/* ── Toolbar flotante ────────────────────────────────────── */
.obj-toolbar {
  position: fixed;
  bottom: 52px;
  left: 16px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 5px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 6px 10px;
  box-shadow: 0 2px 14px rgba(0,0,0,.13);
  transition: opacity .2s, transform .2s;
}
.obj-toolbar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.obj-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 1.5px solid #ddd;
  border-radius: 16px;
  background: #f4f4f4;
  color: #999;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.obj-toggle-btn i { font-size: 11px; }
.obj-toggle-btn.active {
  background: var(--ch-color, #555);
  border-color: var(--ch-color, #555);
  color: white;
}
.obj-toggle-btn:hover:not(.active) {
  border-color: #bbb;
  background: #ebebeb;
  color: #555;
}

.obj-toolbar-sep {
  width: 1px;
  height: 22px;
  background: #e0e0e0;
  margin: 0 3px;
  flex-shrink: 0;
}

.obj-toolbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid #ddd;
  border-radius: 50%;
  background: #f4f4f4;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-family: inherit;
  flex-shrink: 0;
}
.obj-toolbar-icon:hover { background: #e4e4e4; color: #333; }
.obj-toolbar-icon.active {
  background: #1565C0;
  border-color: #1565C0;
  color: white;
}

/* ── Botones lápiz en cada card ──────────────────────────── */
.obj-card-edit-btn {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f5f5f5;
  color: #666;
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.obj-card-edit-btn:hover {
  background: #1565C0;
  border-color: #1565C0;
  color: white;
}

body.obj-edit-mode .obj-card-edit-btn { display: flex; }
body.obj-edit-mode .obj-cards           { outline: 2px dashed #1565C030; border-radius: 10px; }

/* ── Modal de edición ────────────────────────────────────── */
.objedit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.objedit-overlay.open { display: flex; }

.objedit-modal {
  background: white;
  border-radius: 12px;
  width: min(560px, 92vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  overflow: hidden;
}

.objedit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  font-size: 15px;
  color: #222;
  flex-shrink: 0;
}
.objedit-close {
  border: none; background: none;
  font-size: 16px; cursor: pointer; color: #aaa; padding: 4px 8px; line-height: 1;
}
.objedit-close:hover { color: #333; }

.objedit-body { overflow-y: auto; padding: 20px; flex: 1; }

.objedit-field { margin-bottom: 16px; }
.objedit-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #555;
  margin-bottom: 8px;
}
.objedit-hint { font-weight: 400; color: #aaa; text-transform: none; letter-spacing: 0; }

.objedit-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
  transition: border-color .15s;
  box-sizing: border-box;
  color: #222;
}
.objedit-textarea:focus { outline: none; border-color: #1565C0; }

/* Retos list */
.objedit-reto-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.objedit-reto-row .objedit-textarea { flex: 1; }
.objedit-reto-del {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border: 1.5px solid #eee; border-radius: 7px;
  background: white; color: #e53935;
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.objedit-reto-del:hover { background: #ffebee; border-color: #ef9a9a; }

.objedit-add-reto {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  width: 100%; padding: 8px 14px; margin-top: 4px;
  border: 1.5px dashed #1565C0; border-radius: 8px;
  background: #f0f4ff; color: #1565C0;
  font-size: 13px; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.objedit-add-reto:hover { background: #dce8ff; }

/* SIRVE grupos */
.objedit-meta-group { margin-bottom: 18px; }
.objedit-meta-label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid #f0f0f0;
}
.objedit-sirve-check {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 4px; cursor: pointer; font-size: 13px;
  border-radius: 5px; transition: background .1s;
}
.objedit-sirve-check:hover { background: #f5f5f5; }
.objedit-sirve-check input { margin-top: 3px; accent-color: #1565C0; }
.objedit-sirve-code { font-weight: 700; color: #333; min-width: 28px; }
.objedit-sirve-desc { color: #666; line-height: 1.4; }

/* Footer del modal */
.objedit-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid #eee; gap: 8px; flex-shrink: 0;
}
.objedit-footer-right { display: flex; gap: 8px; }

.objedit-btn {
  padding: 8px 18px; border-radius: 8px;
  font-size: 14px; font-family: inherit;
  cursor: pointer; font-weight: 500; border: none;
  transition: background .15s, color .15s;
}
.objedit-btn--primary   { background: #1565C0; color: white; }
.objedit-btn--primary:hover   { background: #0d47a1; }
.objedit-btn--secondary { background: #f0f0f0; color: #333; border: 1px solid #ddd; }
.objedit-btn--secondary:hover { background: #e4e4e4; }
.objedit-btn--ghost     { background: none; color: #e53935; font-size: 13px; padding: 8px 10px; }
.objedit-btn--ghost:hover { background: #ffebee; border-radius: 7px; }

/* ── Toast ───────────────────────────────────────────────── */
.objedit-toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #222;
  color: white;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
.objedit-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.objedit-toast--error { background: #c62828; }

/* ── Hide ch-blocks via body class ──────────────────────── */
body.hide-ch-situacion .ch-block[data-block="situacion"] { display: none; }
body.hide-ch-preguntas .ch-block[data-block="preguntas"] { display: none; }
body.hide-ch-palancas  .ch-block[data-block="palancas"]  { display: none; }

/* ── Toolbar: grupos como flex row ──────────────────────── */
.obj-toolbar-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Edit button en ch-block-title ──────────────────────── */
.ch-block-edit-btn {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f5f5f5;
  color: #666;
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.ch-block-edit-btn:hover {
  background: #1565C0;
  border-color: #1565C0;
  color: white;
}
body.obj-edit-mode .ch-block-edit-btn { display: flex; }

/* ── Process Overview Cards (visión general del capítulo) ── */
.proc-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  padding: 16px 36px 8px;
}

.proc-overview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 32px;
  background: white;
  border: 1px solid #e8e8e8;
  border-left: 3px solid var(--ch-color);
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.proc-overview-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

.proc-overview-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ch-color);
  line-height: 1.3;
}

.proc-overview-obj {
  font-size: 11px;
  color: #555;
  line-height: 1.5;
  flex: 1;
}

.proc-overview-link {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 11px;
  color: var(--ch-color);
  opacity: .6;
}
