/* Bindexp Learning · anotaciones sobre el PDF */

.marcas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.marcas .m-resalte { mix-blend-mode: multiply; opacity: .42; }
.marcas .m-texto { font-family: var(--font); white-space: pre; }
.marcas .m-sel { fill: none; stroke: var(--tint); }
.marcas .m-asa { fill: #fff; stroke: var(--tint); }
.lector.t-noche .marcas { filter: invert(.9) hue-rotate(180deg) contrast(.92); }
.lector.t-noche .marcas .m-resalte { mix-blend-mode: normal; opacity: .38; }
.lector.t-sepia .marcas .m-tapar[fill="#ffffff"] { fill: #f8f1e3; }

/* mientras se dibuja, el texto del PDF no se selecciona ni roba toques */
.lt-paginas.marcando .textLayer, .lt-paginas.marcando .enlaces { pointer-events: none; }
.lt-paginas.marcando { -webkit-user-select: none; user-select: none; }
.lt-paginas.marcando-dedo .pg { touch-action: none; }
.lt-paginas[data-herramienta=pluma] .pg, .lt-paginas[data-herramienta=resaltador] .pg,
.lt-paginas[data-herramienta=forma] .pg, .lt-paginas[data-herramienta=tapar] .pg { cursor: crosshair; }
.lt-paginas[data-herramienta=borrador] .pg { cursor: cell; }
.lt-paginas[data-herramienta=texto] .pg { cursor: text; }
.lt-paginas[data-herramienta=nota] .pg, .lt-paginas[data-herramienta=firma] .pg { cursor: copy; }

.cinta {
  position: absolute; top: -2px; right: 7%; z-index: 4; width: 18px; height: 30px; pointer-events: none;
  background: var(--c-magenta);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
}
.lt-marcador.puesto { color: var(--c-magenta); }

/* editor de texto sobre la página */
.m-editor {
  position: absolute; z-index: 6; margin: 0; padding: 0 2px; min-width: 60px;
  border: 0; outline: 1.5px dashed var(--tint); outline-offset: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, .55); resize: none; overflow: hidden; white-space: pre;
  font-family: var(--font); line-height: 1.25;
}
.m-editor::placeholder { color: rgba(0, 0, 0, .35); }

/* barra de herramientas flotante */
.lector.con-marcado .lt-abajo { transform: translateY(100%); opacity: 0; pointer-events: none; }
.m-barra {
  position: absolute; z-index: 7; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px;
  max-width: calc(100vw - 16px);
  padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--lt-pagina) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  box-shadow: var(--sombra-flotante);
  color: var(--lt-texto);
  animation: barrain .38s var(--ease) both;
}
@keyframes barrain { from { opacity: 0; transform: translate(-50%, 24px); } }
.m-herrs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.m-herrs::-webkit-scrollbar { display: none; }
.m-herr {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; color: var(--lt-texto);
  transition: background .15s, color .15s, transform .2s var(--ease);
}
.m-herr .ico { width: 23px; height: 23px; }
.m-herr:hover { background: var(--lt-fill); }
.m-herr:active { transform: scale(.92); }
.m-herr.activo { background: var(--tint); color: #fff; }
.m-herr.activo:hover { background: var(--tint); }
.m-herr:disabled { opacity: .3; }
.m-tinta { position: absolute; left: 50%; bottom: 4px; width: 14px; height: 3px; margin-left: -7px; border-radius: 2px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2); }
.m-herr.activo .m-tinta { box-shadow: 0 0 0 1px rgba(255, 255, 255, .85); }
.m-div { width: .5px; height: 26px; background: var(--lt-borde); margin: 0 4px; flex: none; }
.m-listo { flex: none; height: 42px; padding: 0 14px; border-radius: 14px; font-weight: 600; font-size: 15px; color: var(--lt-tinta); }
.m-listo:hover { background: var(--lt-fill); }
@media (max-width: 599px) {
  .m-barra { left: 8px; right: 8px; transform: none; max-width: none; border-radius: 20px; animation-name: barrain-movil; }
  .m-herr { width: 40px; height: 40px; }
  /* se desvanece a la derecha: hay más herramientas deslizando */
  .m-herrs { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); padding-right: 18px; }
  .m-herr[data-m] { width: 36px; }
  .m-listo { padding: 0 10px; }
}
@keyframes barrain-movil { from { opacity: 0; transform: translateY(24px); } }

.m-opciones {
  position: absolute; z-index: 8; bottom: calc(76px + env(safe-area-inset-bottom));
  width: 272px; padding: 14px; border-radius: 18px;
  background: color-mix(in srgb, var(--lt-pagina) 94%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  box-shadow: var(--sombra-flotante); color: var(--lt-texto);
  display: grid; gap: 14px;
  animation: menuin .22s var(--ease) both; transform-origin: bottom center;
}
.m-colores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; justify-items: center; }
.m-fila { display: flex; gap: 6px; background: var(--lt-fill); border-radius: 12px; padding: 3px; }
.m-op { flex: 1; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--lt-texto); }
.m-op.activo { background: var(--lt-pagina); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.m-op .ico { width: 21px; height: 21px; }
.m-grosores i { display: block; border-radius: 50%; background: currentColor; }
.m-ancho { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 12px; background: var(--lt-fill); font-size: 14.5px; font-weight: 500; color: var(--lt-texto); }
.m-ancho .ico { width: 19px; height: 19px; }
.m-interruptor { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; cursor: pointer; }
.m-interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.m-interruptor i { width: 46px; height: 28px; border-radius: 14px; background: var(--lt-fill); position: relative; transition: background .2s; flex: none; }
.m-interruptor i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.m-interruptor input:checked + i { background: var(--verde); }
.m-interruptor input:checked + i::after { transform: translateX(18px); }

.m-punto {
  width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  transition: transform .18s var(--ease), box-shadow .15s;
}
.m-punto.grande { width: 34px; height: 34px; }
.m-punto.activo { box-shadow: 0 0 0 2px var(--lt-pagina), 0 0 0 4px var(--c), inset 0 0 0 1px rgba(0, 0, 0, .14); }
.m-punto[style*="#ffffff"].activo { box-shadow: 0 0 0 2px var(--lt-pagina), 0 0 0 4px #b8b8bf, inset 0 0 0 1px rgba(0, 0, 0, .14); }
.m-punto:active { transform: scale(.88); }

/* burbujas: sobre el texto seleccionado y sobre una anotación elegida */
.m-burbuja {
  position: absolute; z-index: 9;
  display: flex; align-items: center; gap: 2px; padding: 6px;
  border-radius: 16px;
  background: color-mix(in srgb, #1d1d1f 92%, transparent); color: #fff;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .45);
  animation: menuin .2s var(--ease) both;
  --lt-pagina: #1d1d1f;
}
.m-burbuja .m-puntos { display: flex; gap: 8px; padding: 0 6px 0 4px; }
.m-burbuja .m-punto { width: 24px; height: 24px; }
.m-burbuja button:not(.m-punto) { width: 38px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.m-burbuja button:not(.m-punto):hover { background: rgba(255, 255, 255, .12); }
.m-burbuja button.peligro { color: #ff6b61; }
.m-burbuja .ico { width: 20px; height: 20px; }

/* ir a página */
.lt-ir { width: 250px; left: 50%; right: auto; margin-left: -125px; }
.lt-ir-fila { display: flex; align-items: center; gap: 10px; }
.lt-ir input {
  width: 84px; height: 42px; border-radius: 11px; border: 0; padding: 0 12px;
  background: var(--lt-fill); color: var(--lt-texto); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.lt-ir input::-webkit-inner-spin-button { -webkit-appearance: none; }
.lt-ir input:focus { box-shadow: inset 0 0 0 2px var(--tint); outline: none; }
.lt-ir span { color: var(--lt-texto-2); font-size: 14px; flex: 1; }
.lt-ir.error { animation: sacudir .4s; }
.lt-pag-txt { cursor: pointer; border-radius: 8px; padding: 4px 6px; }
.lt-pag-txt:hover, .lt-sub:hover { color: var(--lt-tinta); }
.lt-sub { cursor: pointer; }
.lt-abajo .lt-marcador { min-width: 36px; height: 36px; padding: 0; }

/* lista de notas en el panel */
.m-grupo { font-size: 12px; font-weight: 600; color: var(--lt-texto-2); text-transform: uppercase; letter-spacing: .04em; padding: 16px 10px 6px; }
.m-marcadores { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.m-chip-pag { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 11px 0 8px; border-radius: 15px; background: var(--lt-fill); font-size: 13px; font-weight: 500; color: var(--lt-texto); }
.m-chip-pag .ico { color: var(--c-magenta); }
.m-chip-pag.actual { box-shadow: inset 0 0 0 1.5px var(--c-magenta); }
.m-item-lista { display: flex; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; color: var(--lt-texto); font-size: 14px; line-height: 1.4; }
.m-item-lista:hover { background: var(--lt-fill); }
.m-barrita { width: 4px; border-radius: 2px; flex: none; align-self: stretch; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.m-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.m-sub { font-size: 12.5px; color: var(--lt-texto-2); display: flex; gap: 4px; align-items: flex-start; }
.m-sub .ico { flex: none; margin-top: 2px; }

/* firma */
.lienzo-firma { position: relative; height: 190px; border-radius: 14px; background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--sep); margin-top: 8px; color: var(--text); }
.lienzo-firma canvas { width: 100%; height: 100%; display: block; border-radius: inherit; cursor: crosshair; }
.linea-firma { position: absolute; left: 24px; right: 24px; bottom: 44px; border-top: 1px solid var(--sep-fuerte); pointer-events: none; }
.campo textarea.area {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 0; background: var(--fill-2); font-size: 16px; line-height: 1.45;
  box-shadow: inset 0 0 0 1px var(--sep); resize: vertical; min-height: 120px; font-family: inherit; color: var(--text);
}
.campo textarea.area:focus { box-shadow: inset 0 0 0 2px var(--tint); background: var(--elev); outline: none; }

/* imágenes y artifacts en el lector: una sola página */
.lector.doc-unico .lt-abajo { display: none; }
.lector.doc-unico .lt-sub { cursor: default; }
.lector.doc-unico .lt-sub:hover { color: var(--lt-texto-2); }
.lector.doc-unico [data-tab=contenido], .lector.doc-unico [data-tab=paginas] { display: none; }
.lector.doc-unico .lt-paginas { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.pg-html { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; display: block; }
.lt-paginas.marcando .pg-html, .lt-paginas.marcando-dedo .pg-html { pointer-events: none; }
.lector.t-noche .pg-html { filter: invert(.9) hue-rotate(180deg) contrast(.92); }
.lector.t-sepia .pg-html { filter: sepia(.35) brightness(.97); }
.lector.con-marcado .pg-html { pointer-events: none; }
.pg-escudo { position: absolute; inset: 0; z-index: 2; display: none; background: transparent; }
.lector.con-marcado .pg-escudo { display: block; }
