/* ===================================================================
   Manual del Operador — Opera (web)
   Hoja de estilos. Optimizada para pantalla y para impresión / PDF.
   =================================================================== */

/* ---- Página impresa (A4) ---- */
@page {
  size: A4;
  margin: 20mm 16mm 18mm 16mm;
  @bottom-center { content: "Manual del Operador · Opera (web)"; font-family: 'Segoe UI', Arial, sans-serif; font-size: 8pt; color: #94a3b8; }
  @bottom-right  { content: counter(page) " / " counter(pages); font-family: 'Segoe UI', Arial, sans-serif; font-size: 8pt; color: #94a3b8; }
}

* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #1f2937;
  font-size: 10.5pt;
  line-height: 1.55;
  margin: 0;
  background: #eef2f7;               /* fondo de pantalla; en impresión se ignora */
}

/* Lienzo tipo hoja para lectura en pantalla */
.page-wrap {
  max-width: 210mm;
  margin: 0 auto;
  background: #fff;
  padding: 18mm 16mm;
  box-shadow: 0 6px 30px rgba(15,23,42,.12);
}

h1, h2, h3, h4 { color: #13233a; font-weight: 700; line-height: 1.2; }
h2 { font-size: 17pt; margin: 0 0 4px; padding-bottom: 6px; border-bottom: 3px solid #1e3a5f; }
h3 { font-size: 12.5pt; margin: 18px 0 6px; color: #1e3a5f; }
h4 { font-size: 10.8pt; margin: 12px 0 3px; color: #334155; }
p  { margin: 6px 0; }
ul, ol { margin: 6px 0; padding-left: 20px; }
li { margin: 3px 0; }

code, .kbd {
  font-family: 'Consolas', 'SF Mono', monospace;
  background: #eef2f7; border: 1px solid #d7dfea;
  border-radius: 4px; padding: 0 4px; font-size: 9pt; color: #1e3a5f;
}

pre.code {
  background: #13233a; color: #dbeafe;
  border-radius: 8px; padding: 12px 14px; margin: 10px 0;
  font-family: 'Consolas', 'SF Mono', monospace; font-size: 8.6pt;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  overflow-x: auto;
}
pre.code .tok { color: #7dd3fc; }

.section { page-break-before: always; padding-top: 4px; }
.lead { color: #475569; }

/* ---- Portada ---- */
.cover {
  min-height: 257mm;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #1e3a5f 0%, #13233a 60%, #0d1a2c 100%);
  color: #fff; border-radius: 14px; padding: 26mm 20mm;
  page-break-after: always;
}
.cover .brandmark { width: 74px; height: 74px; border-radius: 20px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; font-size: 38px; margin-bottom: 26px; }
.cover h1 { color: #fff; font-size: 34pt; letter-spacing: -.5px; margin: 0; }
.cover .sub { color: #cbd5e1; font-size: 15pt; margin-top: 10px; max-width: 70%; }
.cover .tag { display: inline-block; margin-top: 26px; padding: 6px 14px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font-size: 10pt; color: #e2e8f0; }
.cover .foot { color: #93a4bb; font-size: 9.5pt; border-top: 1px solid rgba(255,255,255,.15); padding-top: 14px; }
.cover .foot strong { color: #e2e8f0; }

/* ---- Índice ---- */
.toc ol { list-style: none; padding-left: 0; counter-reset: toc; }
.toc > ol > li { counter-increment: toc; margin: 5px 0; padding: 7px 12px; background: #f4f7fb; border-left: 3px solid #1e3a5f; border-radius: 4px; font-weight: 600; color: #13233a; }
.toc > ol > li::before { content: counter(toc) ".  "; color: #1e3a5f; }
.toc small { display: block; font-weight: 400; color: #64748b; font-size: 8.8pt; margin-top: 2px; }

/* ---- Recuadros (callouts) ---- */
.box { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 9.8pt; }
.box p:first-child { margin-top: 0; } .box p:last-child { margin-bottom: 0; }
.box .t { font-weight: 700; display: block; margin-bottom: 3px; }
.tip  { background: #ecfdf5; border: 1px solid #a7f3d0; } .tip .t  { color: #047857; }
.warn { background: #fff7ed; border: 1px solid #fed7aa; } .warn .t { color: #c2410c; }
.info { background: #eff6ff; border: 1px solid #bfdbfe; } .info .t { color: #1d4ed8; }
.crit { background: #fef2f2; border: 1px solid #fecaca; } .crit .t { color: #b91c1c; }

/* ---- Tablas ---- */
table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 9.3pt; }
th { background: #1e3a5f; color: #fff; text-align: left; padding: 7px 9px; font-weight: 600; }
td { padding: 6px 9px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
tr:nth-child(even) td { background: #f8fafc; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 8.3pt; font-weight: 700; }
.p-green { background: #d1fae5; color: #065f46; } .p-amber { background: #fef3c7; color: #92400e; }
.p-blue  { background: #dbeafe; color: #1e40af; } .p-rose  { background: #ffe4e6; color: #9f1239; }
.p-gray  { background: #e5e7eb; color: #374151; }
.p-violet{ background: #ede9fe; color: #5b21b6; }
.p-slate { background: #e2e8f0; color: #334155; }

/* Insignia «Nuevo» para marcar novedades de esta versión del manual */
.nuevo {
  display: inline-block; vertical-align: middle;
  margin-left: 6px; padding: 1px 8px;
  background: #dcfce7; color: #15803d; border: 1px solid #86efac;
  border-radius: 999px; font-size: 7.6pt; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase;
}
h2 .nuevo, h3 .nuevo { vertical-align: middle; }

/* ---- Listas de pasos ---- */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding: 4px 0 8px 40px; margin: 0; border-left: 2px dashed #cbd5e1; margin-left: 13px; }
.steps > li:last-child { border-left: 2px solid transparent; }
.steps > li::before { content: counter(step); position: absolute; left: -13px; top: 2px; width: 26px; height: 26px; background: #1e3a5f; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 9.5pt; }
.steps > li strong { color: #13233a; }

/* ---- Tarjetas de caso de uso ---- */
.uc { border: 1px solid #dbe3ee; border-radius: 10px; overflow: hidden; margin: 14px 0; page-break-inside: avoid; }
.uc .h { background: #f4f7fb; padding: 8px 14px; font-weight: 700; color: #13233a; border-bottom: 1px solid #dbe3ee; }
.uc .h .n { color: #1e3a5f; }
.uc .b { padding: 10px 14px; font-size: 9.8pt; }
.uc .b p { margin: 4px 0; }

/* ---- FAQ ---- */
.faq { page-break-inside: avoid; margin: 10px 0; }
.faq .q { font-weight: 700; color: #1e3a5f; }
.faq .a { margin: 2px 0 0; color: #334155; }

/* ---- Término resaltado / seleccionable ---- */
mark.term {
  background: #fff3bf;
  color: #7c4a03;
  padding: 0 4px;
  border-radius: 4px;
  border-bottom: 2px solid #f59e0b;
  font-weight: 600;
  cursor: help;
}
a { color: #1e40af; }

/* ---- Utilidades ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; }
.mini h4 { margin: 0 0 3px; }
.muted { color: #64748b; font-size: 9pt; }
.flow { background: #13233a; color: #dbeafe; border-radius: 8px; padding: 10px 14px; font-size: 9.2pt; font-family: 'Consolas', monospace; margin: 10px 0; }
.flow b { color: #7dd3fc; }

/* ---- Botón flotante de compartir (solo pantalla) ---- */
.share-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  display: inline-flex; align-items: center; gap: 8px;
  background: #1e3a5f; color: #fff; border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(30,58,95,.35);
  font-family: inherit; transition: transform .1s, background .2s;
}
.share-fab:hover { background: #13233a; }
.share-fab:active { transform: scale(.96); }

/* ---- Aviso emergente «enlace copiado» ---- */
.share-toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(10px);
  z-index: 400; max-width: 90vw;
  background: #13233a; color: #fff; border-radius: 999px;
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(9,15,26,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.share-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Protección: no seleccionar ni copiar el contenido ---- */
body {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

/* ---- Ajustes solo para impresión / PDF ---- */
@media print {
  body { background: #fff; }
  .page-wrap { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .share-fab, .share-toast { display: none !important; }
  .cover { border-radius: 0; }
}

/* ===================================================================
   INTERACTIVIDAD E ILUSTRACIONES (solo pantalla)
   Mockups de las pantallas de la app, referencias que abren la imagen
   en una ventana emergente (lightbox) y FAQ desplegable.
   =================================================================== */

/* ---- Chip de referencia: abre la ilustración en una ventana ---- */
.ref-fig {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8;
  border-radius: 999px; padding: 0 9px; margin: 0 1px;
  font: inherit; font-size: .92em; font-weight: 600; line-height: 1.7;
  cursor: pointer; vertical-align: baseline; transition: background .15s, box-shadow .15s;
}
.ref-fig:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(30,64,175,.18); }
.ref-fig:active { transform: translateY(1px); }
.ref-fig::before { content: "🔍"; font-size: .95em; }
.ref-fig.icono-img::before { content: "🖼️"; }

/* ---- Figura ilustrativa embebida en el documento ---- */
figure.figura {
  margin: 16px 0; padding: 0; border: 1px solid #dbe3ee; border-radius: 14px;
  background: #f4f7fb; overflow: hidden; page-break-inside: avoid;
}
figure.figura > .figura-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: #e7edf6; border-bottom: 1px solid #dbe3ee;
  font-size: 8.6pt; font-weight: 700; color: #1e3a5f; text-transform: uppercase; letter-spacing: .4px;
}
figure.figura > .figura-head .fh-badge {
  margin-left: auto; font-size: 7.4pt; background: #1e3a5f; color: #fff;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .3px;
}
figure.figura .figura-body { padding: 16px; display: flex; justify-content: center; }
figure.figura figcaption { padding: 4px 14px 12px; font-size: 8.8pt; color: #64748b; text-align: center; }
.btn-ampliar {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 auto 12px; padding: 5px 12px;
  border: 1px solid #cbd5e1; background: #fff; color: #1e3a5f; border-radius: 999px;
  font: inherit; font-size: 8.6pt; font-weight: 600; cursor: pointer;
}
.btn-ampliar::before { content: "⤢"; }
.btn-ampliar:hover { background: #f1f5f9; }

/* ---- «Teléfono»: mockups de las pantallas reales de Opera (web) ---- */
.screen {
  width: 300px; max-width: 100%; border-radius: 26px; padding: 16px 14px 20px;
  background: linear-gradient(180deg, #1e3a5f 0%, #16293f 100%);
  color: #fff; box-shadow: 0 10px 30px rgba(15,23,42,.28); border: 6px solid #0e1b2c;
  font-size: 8.6pt; line-height: 1.4;
}
.screen .sc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.screen .sc-ico { width: 26px; height: 26px; border-radius: 9px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; }
.screen .sc-kick { font-size: 6.8pt; text-transform: uppercase; letter-spacing: .6px; color: rgba(255,255,255,.45); }
.screen .sc-title { font-size: 11pt; font-weight: 700; line-height: 1.1; }
.screen .sc-sub { font-size: 7.6pt; color: rgba(255,255,255,.6); }
.screen .sc-btnalt { margin-left: auto; background: rgba(255,255,255,.12); border-radius: 8px; padding: 4px 8px; font-size: 7.4pt; color: rgba(255,255,255,.75); }

.sc-card { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; }
.sc-row + .sc-row { border-top: 1px solid rgba(255,255,255,.08); }
.sc-label { color: rgba(255,255,255,.5); font-size: 7.8pt; }
.sc-val { font-weight: 700; }
.sc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* Mosaico de opciones (accesos a módulos / botones grandes) */
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-tile { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 14px;
  padding: 12px 8px; text-align: center; position: relative; }
.sc-tile .e { font-size: 18px; display: block; }
.sc-tile .l { font-size: 7.8pt; font-weight: 600; margin-top: 4px; }
.sc-tile .h { font-size: 6.8pt; color: rgba(255,255,255,.35); margin-top: 2px; }
.sc-tile.amber { background: rgba(251,191,36,.16); border-color: rgba(251,191,36,.5); }
.sc-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; border-radius: 999px;
  background: #fbbf24; color: #1e3a5f; font-size: 7pt; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.sc-badge.blue { background: #60a5fa; }
.sc-full { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.sc-full .e { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.sc-full .tt { font-weight: 700; }
.sc-full .dd { font-size: 7.4pt; color: rgba(255,255,255,.5); }
.sc-full .ar { margin-left: auto; color: rgba(255,255,255,.35); }
.sc-full.activo { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }

/* Fila de estadísticas (resumen de jornada) */
.sc-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.sc-stat { border-radius: 10px; padding: 8px 3px; text-align: center; border: 1px solid; }
.sc-stat .n { font-size: 12pt; font-weight: 800; line-height: 1; }
.sc-stat .t { font-size: 5.8pt; margin-top: 3px; opacity: .9; line-height: 1.05; }
.st-emerald { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
.st-amber { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.3); color: #fcd34d; }
.st-blue { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.3); color: #93c5fd; }
.st-violet { background: rgba(139,92,246,.15); border-color: rgba(139,92,246,.3); color: #c4b5fd; }
.st-rose { background: rgba(244,63,94,.15); border-color: rgba(244,63,94,.3); color: #fda4af; }

/* Avisos internos del teléfono */
.sc-note { border-radius: 10px; padding: 7px 10px; font-size: 7.4pt; margin-bottom: 8px; }
.sc-note.amber { background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.35); color: #fcd34d; }
.sc-note.blue { background: rgba(59,130,246,.14); border: 1px solid rgba(59,130,246,.35); color: #93c5fd; }

/* Campos de formulario simulados */
.sc-field { margin-bottom: 9px; }
.sc-field .fl { font-size: 6.6pt; text-transform: uppercase; letter-spacing: .4px; color: rgba(255,255,255,.4); margin-bottom: 3px; }
.sc-field .fi { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.2); border-radius: 9px; padding: 7px 9px; font-size: 8pt; color: rgba(255,255,255,.85); }
.sc-field .fi.ph { color: rgba(255,255,255,.35); }
.sc-chiprow { display: flex; flex-wrap: wrap; gap: 5px; }
.sc-chip { border-radius: 8px; padding: 4px 8px; font-size: 7.4pt; font-weight: 600; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); }
.sc-chip.sel { background: #fff; color: #1e3a5f; border-color: #fff; }
.sc-firma { background: #fff; border-radius: 10px; height: 66px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 8pt; position: relative; }
.sc-firma .sig { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #0f172a; font-family: 'Segoe Script','Brush Script MT',cursive; font-size: 15pt; transform: rotate(-4deg); }
.sc-cta { background: #34d399; color: #0f2a1a; border-radius: 10px; text-align: center; padding: 9px; font-weight: 800; font-size: 8.4pt; margin-top: 4px; }
.sc-cta.ghost { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); }
.sc-photo { border: 1px dashed rgba(255,255,255,.3); border-radius: 10px; padding: 16px; text-align: center; color: rgba(255,255,255,.5); font-size: 7.6pt; }
.sc-scan { border: 2px solid rgba(96,165,250,.5); border-radius: 12px; height: 74px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.55); font-size: 7.6pt; background: rgba(96,165,250,.08); margin-bottom: 9px; position: relative; }
.sc-scan::after { content: ""; position: absolute; left: 12%; right: 12%; height: 2px; background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }
.sc-list .li { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-top: 1px solid rgba(255,255,255,.08); }
.sc-list .li:first-child { border-top: none; }
.sc-list .li .g { flex: 1; min-width: 0; }
.sc-list .li .f { font-weight: 700; font-size: 8pt; }
.sc-list .li .c { font-family: 'Consolas',monospace; font-size: 7pt; color: rgba(255,255,255,.4); }
.sc-tag { font-size: 6.6pt; font-weight: 700; border-radius: 999px; padding: 2px 7px; }
.sc-prog { height: 4px; border-radius: 999px; background: rgba(255,255,255,.12); margin: 8px 0; overflow: hidden; }
.sc-prog > i { display: block; height: 100%; background: #34d399; border-radius: 999px; }

/* Anotaciones tipo «globo» sobre el mockup */
.mock-wrap { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.mock-notes { max-width: 220px; font-size: 8.4pt; }
.mock-notes li { margin: 6px 0; padding-left: 22px; position: relative; color: #334155; list-style: none; }
.mock-notes { padding-left: 0; }
.mock-notes li .k { position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%;
  background: #1e3a5f; color: #fff; font-size: 7pt; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ---- Lightbox (ventana emergente con la ilustración) ---- */
.lb-overlay {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(9,15,26,.72); backdrop-filter: blur(3px);
}
.lb-overlay.abierto { display: flex; }
.lb-card {
  background: #fff; border-radius: 18px; max-width: 460px; width: 100%;
  max-height: 92vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.4);
  animation: lbin .18s ease-out;
}
@keyframes lbin { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.lb-head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #1e3a5f; color: #fff; }
.lb-head .lb-t { font-weight: 700; font-size: 11pt; }
.lb-head .lb-x { margin-left: auto; width: 30px; height: 30px; border-radius: 9px; border: none;
  background: rgba(255,255,255,.14); color: #fff; font-size: 16px; cursor: pointer; line-height: 1; }
.lb-head .lb-x:hover { background: rgba(255,255,255,.26); }
.lb-body { padding: 18px; display: flex; justify-content: center; }
.lb-cap { padding: 0 18px 16px; font-size: 9pt; color: #475569; text-align: center; }

/* ---- FAQ desplegable ---- */
.faq.acc .q { cursor: pointer; display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; background: #f4f7fb; border: 1px solid #e2e8f0; border-radius: 8px; margin: 0; user-select: none; }
.faq.acc .q::before { content: "▸"; color: #1e3a5f; transition: transform .15s; margin-top: 1px; }
.faq.acc.abierta .q::before { transform: rotate(90deg); }
.faq.acc .q:hover { background: #eef2f8; }
.faq.acc .a { max-height: 0; overflow: hidden; padding: 0 12px; transition: max-height .2s ease, padding .2s ease; }
.faq.acc.abierta .a { max-height: 600px; padding: 8px 12px 10px; }

/* ---- Referencia cruzada a un capítulo (hipervínculo) ---- */
a.xref { color: #1d4ed8; text-decoration: none; border-bottom: 1px dotted #93b4f5; font-weight: 600; }
a.xref:hover { border-bottom-style: solid; background: #eff6ff; }

/* ===================================================================
   ÍNDICE FLOTANTE (lateral izquierdo) + navbar móvil con hamburguesa
   =================================================================== */
.side-toc {
  position: fixed; top: 0; left: 0; z-index: 200;
  width: 256px; height: 100vh; overflow-y: auto;
  background: #13233a; color: #fff;
  padding: 18px 12px 24px; box-shadow: 4px 0 24px rgba(9,15,26,.35);
  transform: translateX(-100%); transition: transform .22s ease;
  -webkit-overflow-scrolling: touch;
}
.side-toc.abierto { transform: translateX(0); }
.side-toc .st-h { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; }
.side-toc .st-h .st-mark { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; font-size: 16px; }
.side-toc .st-h .st-kick { font-size: 8px; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.45); }
.side-toc .st-h .st-title { font-size: 15px; font-weight: 700; line-height: 1; }
.side-toc .st-x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: none;
  background: rgba(255,255,255,.12); color: #fff; font-size: 15px; cursor: pointer; }
.side-toc ol { list-style: none; counter-reset: st; margin: 0; padding: 0; }
.side-toc li { counter-increment: st; }
.side-toc a.st-link {
  display: flex; gap: 8px; align-items: baseline; text-decoration: none;
  color: rgba(255,255,255,.72); font-size: 12.5px; line-height: 1.25;
  padding: 7px 9px; border-radius: 9px; border-left: 3px solid transparent;
}
.side-toc a.st-link::before { content: counter(st); flex: 0 0 auto; width: 18px; text-align: right;
  color: rgba(255,255,255,.4); font-weight: 700; font-size: 11px; }
.side-toc a.st-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-toc a.st-link.activo { background: rgba(96,165,250,.16); color: #fff; border-left-color: #60a5fa; }
.side-toc a.st-link.activo::before { color: #93c5fd; }

.side-toc-back { position: fixed; inset: 0; z-index: 190; background: rgba(9,15,26,.55);
  display: none; backdrop-filter: blur(1px); }
.side-toc-back.abierto { display: block; }

/* Navbar superior (solo cuando el índice está colapsado) */
.toc-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 180; height: 46px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: rgba(19,35,58,.96); color: #fff; box-shadow: 0 2px 10px rgba(9,15,26,.25);
}
.toc-navbar .hamb { width: 34px; height: 34px; border-radius: 9px; border: none; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; }
.toc-navbar .hamb svg { width: 18px; height: 18px; }
.toc-navbar .nav-t { font-size: 13px; font-weight: 700; }
.toc-navbar .nav-t small { display: block; font-size: 8.5px; font-weight: 500; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .6px; }
body.con-navbar { padding-top: 46px; }

/* Escritorio amplio: índice fijo a la vista, sin navbar ni hamburguesa. */
@media screen and (min-width: 1280px) {
  .side-toc { transform: translateX(0); box-shadow: none; border-right: 1px solid rgba(255,255,255,.06); }
  .side-toc .st-x { display: none; }
  .toc-navbar { display: none; }
  .side-toc-back { display: none !important; }
  body.con-navbar { padding-top: 0; }
  /* Reserva el ancho del índice para que no tape la hoja centrada. */
  body { padding-left: 256px; }
}

@media print {
  .side-toc, .side-toc-back, .toc-navbar { display: none !important; }
  body.con-navbar { padding-top: 0 !important; }
  body { padding-left: 0 !important; }
}

/* ---- Botón «volver arriba» ---- */
.top-fab { position: fixed; right: 22px; bottom: 78px; z-index: 100; width: 44px; height: 44px; border-radius: 50%;
  background: #13233a; color: #fff; border: none; cursor: pointer; font-size: 18px; display: none;
  box-shadow: 0 6px 18px rgba(15,23,42,.35); }
.top-fab.visible { display: block; }

/* ---- Impresión: mostrar figuras, ocultar interacción ---- */
@media print {
  .ref-fig { border: none; background: none; color: #1e40af; padding: 0; font-weight: 600; }
  .ref-fig::before { content: ""; }
  .ref-fig::after { content: " (ver ilustración)"; font-size: .85em; color: #64748b; }
  .btn-ampliar, .lb-overlay, .top-fab { display: none !important; }
  .faq.acc .a { max-height: none !important; padding: 8px 12px 10px !important; }
  .faq.acc .q { cursor: default; }
  figure.figura { break-inside: avoid; }
  .screen { box-shadow: none; }
}

/* ---- Responsivo en pantallas pequeñas ---- */
@media screen and (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .page-wrap { padding: 14px; }
  .cover .sub { max-width: 100%; }
  .mock-wrap { flex-direction: column; align-items: center; }
}

/* ===================================================================
   APARTADOS POR ROL (chofer · cliente · administrador)
   Selector de manuales en portada, portadas de apartado, índice
   agrupado y placeholder «en construcción».
   =================================================================== */

/* ---- Selector de apartados (3 tarjetas, tras la portada) ---- */
.apartados { page-break-after: always; margin: 6px 0 4px; }
.apartados .ap-kick { text-align: center; color: #64748b; font-size: 9.5pt; text-transform: uppercase; letter-spacing: 1.2px; margin: 0 0 4px; }
.apartados .ap-title { text-align: center; color: #13233a; font-size: 18pt; font-weight: 700; margin: 0 0 4px; }
.apartados .ap-lead { text-align: center; color: #475569; max-width: 560px; margin: 0 auto 16px; }
.apartados .ap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.apartado-card {
  display: block; text-decoration: none; color: inherit; border-radius: 14px;
  border: 1px solid #dbe3ee; background: #fff; padding: 18px 16px; position: relative;
  transition: transform .12s, box-shadow .15s, border-color .15s; page-break-inside: avoid;
}
.apartado-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15,23,42,.12); border-color: #c7d3e3; }
.apartado-card .ap-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 12px; }
.apartado-card .ap-rol { font-size: 13pt; font-weight: 700; color: #13233a; }
.apartado-card .ap-desc { font-size: 9pt; color: #64748b; margin-top: 4px; line-height: 1.45; }
.apartado-card .ap-go { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 9pt; font-weight: 700; }
.apartado-card .ap-go::after { content: "→"; }
.apartado-card.rol-chofer .ap-ico { background: #e7edf6; color: #1e3a5f; }
.apartado-card.rol-chofer .ap-go { color: #1e3a5f; }
.apartado-card.rol-cliente .ap-ico { background: #fff1e7; color: #c2410c; }
.apartado-card.rol-cliente .ap-go { color: #c2410c; }
.apartado-card.rol-admin .ap-ico { background: #eef2f7; color: #475569; }
.apartado-card.rol-admin .ap-go { color: #475569; }
.apartado-card.rol-dev .ap-ico { background: #eef2ff; color: #4338ca; }
.apartado-card.rol-dev .ap-go { color: #4338ca; }
.apartado-card .ap-flag { position: absolute; top: 12px; right: 12px; font-size: 7.4pt; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 999px; }
.apartado-card .ap-flag.listo { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.apartado-card .ap-flag.pronto { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---- Índice agrupado por apartado (encabezados de parte) ---- */
.toc .toc-part {
  margin: 18px 0 6px; padding: 6px 10px; border-radius: 6px;
  font-size: 11pt; color: #13233a; background: #eef2f7; border-left: 4px solid #1e3a5f;
}
.toc .toc-part:first-of-type { margin-top: 10px; }
.toc .toc-part.tp-cliente { border-left-color: #f97316; }
.toc .toc-part.tp-admin { border-left-color: #94a3b8; }

/* ---- Portada de cada apartado (divisor de parte) ---- */
.part-cover {
  page-break-before: always; border-radius: 14px; color: #fff; padding: 30px 26px;
  margin: 10px 0 4px; display: flex; align-items: center; gap: 18px;
  background: linear-gradient(160deg, #1e3a5f 0%, #13233a 70%);
}
.part-cover.pc-cliente { background: linear-gradient(160deg, #ea580c 0%, #9a3412 70%); }
.part-cover.pc-admin { background: linear-gradient(160deg, #475569 0%, #1e293b 70%); }
.part-cover .pc-badge { width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: 32px; flex: 0 0 auto; }
.part-cover .pc-kick { font-size: 9pt; text-transform: uppercase; letter-spacing: 1.4px; color: rgba(255,255,255,.7); }
.part-cover .pc-title { font-size: 22pt; font-weight: 700; line-height: 1.1; margin: 2px 0 0; }
.part-cover .pc-sub { font-size: 10.5pt; color: rgba(255,255,255,.82); margin-top: 6px; max-width: 62ch; }

/* ---- Placeholder «en construcción» (apartado administrador) ---- */
.en-construccion {
  border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc;
  padding: 30px 24px; text-align: center; margin: 16px 0; page-break-inside: avoid;
}
.en-construccion .ec-ico { font-size: 40px; }
.en-construccion h3 { margin: 8px 0 4px; color: #334155; border: none; }
.en-construccion p { color: #64748b; max-width: 60ch; margin: 4px auto; }
.en-construccion .ec-tag { display: inline-block; margin-top: 12px; padding: 5px 14px; border-radius: 999px; background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-size: 9pt; font-weight: 700; }

/* ---- Índice lateral: acordeón por apartado (chofer / cliente / admin) ---- */
.side-toc .st-part { counter-increment: none; list-style: none; margin: 6px 0; }
.side-toc .st-part:first-child { margin-top: 0; }

/* Encabezado del apartado: barra resaltada y clicable */
.side-toc .st-group {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; margin: 0; border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px; background: rgba(255,255,255,.05); cursor: pointer;
  color: #fff; font: inherit; text-align: left;
  transition: background .15s, border-color .15s;
}
.side-toc .st-group .st-group-t {
  flex: 1; font-size: 12px; font-weight: 800; letter-spacing: .3px;
}
.side-toc .st-group .st-caret {
  width: 16px; height: 16px; flex: 0 0 auto; color: rgba(255,255,255,.55);
  transition: transform .2s ease;
}
.side-toc .st-group:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); }

/* Apartado abierto: cabecera destacada + caret girado + panel visible */
.side-toc .st-part.open > .st-group {
  background: rgba(96,165,250,.18); border-color: rgba(96,165,250,.45);
}
.side-toc .st-part.open > .st-group .st-caret { transform: rotate(180deg); color: #93c5fd; }

/* Panel plegable con las entradas del apartado */
.side-toc .st-sub {
  counter-reset: st; overflow: hidden; margin: 0; padding: 0;
  max-height: 0; opacity: .3;
  transition: max-height .28s ease, opacity .2s ease, padding .28s ease;
}
.side-toc .st-part.open > .st-sub {
  max-height: 1600px; opacity: 1; padding: 4px 0 6px;
}
/* Barra guía a la izquierda de las entradas del apartado abierto */
.side-toc .st-part.open > .st-sub { border-left: 2px solid rgba(96,165,250,.35); margin-left: 12px; }
.side-toc .st-sub .st-link { padding-left: 10px; }

/* En impresión: mostrar todo desplegado, sin caret ni fondos */
@media print {
  .side-toc { display: none !important; }
}

/* ---- Responsivo: apartados en una columna ---- */
@media screen and (max-width: 720px) {
  .apartados .ap-grid { grid-template-columns: 1fr; }
  .part-cover { flex-direction: column; text-align: center; }
}

@media print {
  .apartado-card:hover { transform: none; box-shadow: none; }
  .part-cover { border-radius: 0; }
}

/* ---- Índice impreso: las entradas ahora son enlaces (misma apariencia) ---- */
.toc > ol > li > a { color: inherit; text-decoration: none; display: block; cursor: pointer; }
.toc > ol > li > a:hover { color: #1e3a5f; }
.toc > ol > li > a small { cursor: default; }

/* ===================================================================
   PORTADAS DE APARTADO (página completa, como la portada principal)
   Cada apartado (chofer / cliente / admin) abre con una portada grande
   al estilo de la portada del operador, con su propio color.
   =================================================================== */
.cover.cover-parte { page-break-before: always; }
.cover .cover-kick {
  display: inline-block; margin-bottom: 6px;
  font-size: 11pt; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: rgba(255,255,255,.75);
}
/* Color por apartado (mismo tamaño que la portada principal) */
.cover-chofer  { background: linear-gradient(160deg, #1e3a5f 0%, #13233a 60%, #0d1a2c 100%); }
.cover-cliente { background: linear-gradient(160deg, #ea580c 0%, #9a3412 60%, #7c2d12 100%); }
.cover-admin   { background: linear-gradient(160deg, #475569 0%, #1e293b 60%, #0f172a 100%); }
.cover-dev     { background: linear-gradient(160deg, #4f46e5 0%, #3730a3 60%, #1e1b4b 100%); }
