/* ============================================================================
   BLOQUEO — estado «bloqueado» de una función de Pro (js/bloqueo.js)
   ----------------------------------------------------------------------------
   .bq       el bloque: relleno sintético desenfocado (.bq-fill, aria-hidden)
             de alto fijo y, montada sobre su mitad de abajo, la tarjeta
             (.bq-card) con candado, título, texto y acciones. El relleno
             siempre asoma arriba (--bq-fill-h − --bq-over) y la tarjeta crece
             hacia abajo con su texto, así nunca se sale en el teléfono.
   .bq-compacto  para paneles y tarjetas angostas.
   Solo colores de tokens.css. El tono del candado sigue al modo: Salviati
   (pizarra) en «paso» y «profundizar», Sagredo (azul de acción) en «sagredo»
   y azul de acción en lo demás. Usa --salviati y --sagredo si tokens.css los
   define; si no, los valores del sistema de diseño (claro y oscuro, abajo).
   Contraste (test-bloqueo.js lo mide): ink, ink2 y accent-text ≥ 4.5:1 sobre
   --raised; blanco sobre --accent-fill ≥ 4.5:1; candado ≥ 3:1.
   ========================================================================== */
.bq {
  --bq-sal: #2f4a57; --bq-sal-soft: rgba(47, 74, 87, .10);
  --bq-sag: #0062cc; --bq-sag-soft: rgba(0, 98, 204, .10);
  --bq-tone: var(--accent-text); --bq-tone-soft: var(--accent-soft);
  --bq-bar: var(--fill2);
  --bq-fill-h: 208px; --bq-over: 112px;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border-radius: var(--r-panel, 14px);
  background: var(--paper);
  box-shadow: inset 0 0 0 .5px var(--sep2);
  color: var(--ink); font-family: var(--ui); text-align: left;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bq {
    --bq-sal: #9fbccb; --bq-sal-soft: rgba(159, 188, 203, .16);
    --bq-sag: #5aabff; --bq-sag-soft: rgba(90, 171, 255, .16);
  }
}
:root[data-theme="dark"] .bq {
  --bq-sal: #9fbccb; --bq-sal-soft: rgba(159, 188, 203, .16);
  --bq-sag: #5aabff; --bq-sag-soft: rgba(90, 171, 255, .16);
}
.bq[data-modo="salviati"] { --bq-tone: var(--salviati, var(--bq-sal)); --bq-tone-soft: var(--salviati-soft, var(--bq-sal-soft)); }
.bq[data-modo="sagredo"] { --bq-tone: var(--sagredo, var(--bq-sag)); --bq-tone-soft: var(--sagredo-soft, var(--bq-sag-soft)); }

/* ---------------------------------------------------- RELLENO SINTÉTICO
   Cajas vacías con la forma de un paso (renglones, fórmulas, diagramas);
   se desenfocan y se desvanecen hacia abajo. No llevan texto.             */
.bq-fill {
  flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0;
  height: var(--bq-fill-h); overflow: hidden; padding: 24px 28px 0;
  filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 92%);
  mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 92%);
  pointer-events: none; -webkit-user-select: none; user-select: none;
}
.bq-fill > * { flex: none; max-width: 100%; }
.bq-fill span { flex: none; }  /* todas son hijas de flex o absolutas: ya son de bloque */
.bq-l { height: 10px; border-radius: 5px; background: var(--bq-bar); }
.bq-fill > .bq-l { margin-left: 36px; max-width: calc(100% - 36px); }
.bq-w2 { width: 34%; } .bq-w3 { width: 48%; } .bq-w4 { width: 62%; } .bq-w5 { width: 76%; } .bq-w6 { width: 90%; }
.bq-thin { height: 8px; }
.bq-sub { height: 12px; background: var(--ink3); opacity: .5; }
.bq-fill > .bq-sub { margin-left: 0; }
/* encabezado de paso: número y título */
.bq-hd { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 4px; }
.bq-n { width: 24px; height: 24px; border-radius: 7px; background: var(--fill2); }
.bq-hd > .bq-l { height: 14px; border-radius: 7px; background: var(--ink3); opacity: .55; }
/* fórmula: símbolo = fracción + símbolo fracción / ∫ M m */
.bq-fm { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-left: 36px; }
.bq-sy { width: 26px; height: 14px; border-radius: 4px; background: var(--ink3); opacity: .6; }
.bq-sy2 { width: 18px; }
.bq-eq { width: 14px; height: 7px; border-top: 2px solid var(--ink3); border-bottom: 2px solid var(--ink3); opacity: .7; }
.bq-op { width: 12px; height: 2px; background: var(--ink3); opacity: .7; }
.bq-fr { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bq-fr > span { width: 40px; height: 9px; border-radius: 4.5px; background: var(--bq-bar); }
.bq-fr > span:last-child { width: 28px; }
.bq-fr > .bq-rule { width: 58px; height: 1.5px; border-radius: 0; background: var(--ink3); }
.bq-int { width: 14px; height: 38px; border-radius: 7px 2px 7px 2px; border-left: 2.5px solid var(--ink3); transform: skewX(-12deg); opacity: .7; }
.bq-ch { width: 32px; height: 20px; border-radius: 6px; background: var(--fill); }
.bq-real { background: var(--real-soft); box-shadow: inset 0 0 0 1.5px var(--real); }
.bq-virt { background: var(--virt-soft); box-shadow: inset 0 0 0 1.5px var(--virt); }
.bq-defl { background: var(--defl-soft); box-shadow: inset 0 0 0 1.5px var(--defl); }
.bq-uds { display: flex; align-items: center; gap: 10px; margin-left: 36px; }
/* diagrama: eje de la viga y momento real bajo él */
.bq-fig { position: relative; width: calc(100% - 36px); height: 96px; margin-left: 36px; }
.bq-fig > span { position: absolute; }
.bq-bm { left: 4%; right: 4%; top: 26px; height: 5px; border-radius: 2px; background: var(--beam); }
.bq-dg { left: 8%; right: 8%; top: 31px; height: 56px; border: 2px solid var(--real); border-top: 0; border-radius: 0 0 50% 50% / 0 0 100% 100%; background: var(--real-soft); }
/* viga con tres apoyos y su elástica (hiperestática) */
.bq-sp { top: 31px; width: 0; height: 0; margin-left: -9px; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 14px solid var(--beam-edge); }
.bq-sp1 { left: 6%; } .bq-sp2 { left: 50%; } .bq-sp3 { left: 94%; }
.bq-el { top: 36px; height: 26px; border-bottom: 2.5px solid var(--defl); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.bq-el1 { left: 6%; right: 50%; } .bq-el2 { left: 50%; right: 6%; }
/* resultado en recuadro (δ, θ) */
.bq-cj { display: flex; align-items: center; gap: 10px; height: 38px; margin-left: 36px; padding: 0 16px; border-radius: 8px; background: var(--defl-soft); box-shadow: inset 0 0 0 1.5px var(--defl); }
.bq-v { width: 72px; }
/* Sagredo: pregunta, casilla de respuesta y pistas */
.bq-ask { display: flex; align-items: center; gap: 12px; width: calc(100% - 36px); margin-left: 36px; }
.bq-q { width: 30%; }
.bq-in { width: 128px; height: 32px; border-radius: 8px; background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--bq-tone); opacity: .8; }
.bq-u { width: 28px; height: 10px; border-radius: 5px; background: var(--bq-bar); }
.bq-pis { display: flex; gap: 8px; margin-left: 36px; }
.bq-pis > span { width: 72px; height: 24px; border-radius: 12px; background: var(--fill); }
/* filas de lista: ejercicios guardados, dispositivos */
.bq-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.bq-ico { width: 44px; height: 32px; border-radius: 6px; background: var(--fill2); }
.bq-rt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bq-fill .bq-rt { flex: 1 1 auto; }

/* -------------------------------------------------------------- TARJETA */
.bq-card {
  position: relative; z-index: 1; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(440px, calc(100% - 32px)); margin: calc(var(--bq-over) * -1) auto 20px; padding: 24px 24px 18px;
  border-radius: var(--r-panel, 14px);
  background: var(--raised);
  box-shadow: 0 0 0 .5px var(--sep2), var(--float);
  text-align: center;
}
.bq-lock { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 20px; background: var(--bq-tone-soft); color: var(--bq-tone); }
.bq-t { margin: 0; font-family: var(--ui); font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.bq-x { margin: 0; max-width: 34em; font-size: 14px; line-height: 20px; color: var(--ink2); text-wrap: pretty; }
.bq-acts { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.bq-acts > .btn-primary { height: 34px; border-radius: 17px; padding: 0 18px; font-size: 13.5px; }
.bq-acts > .btn-link { min-height: 28px; padding: 0 8px; font-size: 13px; }
.bq-precio { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink2); }

/* ------------------------------------------------------------ COMPACTO */
.bq-compacto { --bq-fill-h: 156px; --bq-over: 84px; }
.bq-compacto .bq-fill { padding: 16px 16px 0; gap: 10px; }
.bq-compacto .bq-fill > .bq-l, .bq-compacto .bq-fm, .bq-compacto .bq-fig, .bq-compacto .bq-cj,
.bq-compacto .bq-ask, .bq-compacto .bq-uds, .bq-compacto .bq-pis { margin-left: 0; }
.bq-compacto .bq-fill > .bq-l { max-width: 100%; }
.bq-compacto .bq-fig, .bq-compacto .bq-ask { width: 100%; }
.bq-compacto .bq-card { width: calc(100% - 24px); margin-bottom: 12px; padding: 16px 12px 12px; gap: 6px; }
.bq-compacto .bq-lock { width: 32px; height: 32px; border-radius: 16px; margin-bottom: 2px; }
.bq-compacto .bq-t { font-size: 15px; line-height: 20px; }
.bq-compacto .bq-x { font-size: 13px; line-height: 18px; }
.bq-compacto .bq-acts { margin-top: 4px; }

/* ---------------------------------- TELÉFONO: objetivos táctiles de 44 px */
@media (max-width: 759px), (pointer: coarse) {
  .bq:not(.bq-compacto) { --bq-fill-h: 184px; --bq-over: 96px; }
  .bq:not(.bq-compacto) .bq-fill { padding: 20px 16px 0; }
  .bq-fill > .bq-l, .bq-fm, .bq-fig, .bq-cj, .bq-ask, .bq-uds, .bq-pis { margin-left: 0; }
  .bq-fill > .bq-l { max-width: 100%; }
  .bq-fig, .bq-ask { width: 100%; }
  .bq-card { padding: 20px 16px 12px; }
  .bq-x { font-size: 15px; line-height: 21px; }
  .bq-acts { align-self: stretch; gap: 4px; }
  .bq-acts > .btn-primary { width: 100%; max-width: 320px; align-self: center; height: 44px; border-radius: 22px; padding: 0 20px; font-size: 15px; }
  .bq-acts > .btn-link { min-height: 44px; padding: 0 12px; font-size: 15px; }
  .bq-precio { font-size: 13px; line-height: 18px; }
}

/* -------------------------------------------------- IMPRIMIR Y CONTRASTE
   En papel no hay relleno ni botones: queda el aviso de una línea. Sin el
   relleno, la tarjeta pierde su margen negativo (si no, se recortaría).   */
@media print {
  .bq { display: block; background: none; box-shadow: none; overflow: visible; }
  .bq-fill, .bq-lock, .bq-acts > .btn { display: none !important; }
  .bq-card { width: auto; margin: 0; padding: 8pt 10pt; align-items: flex-start; text-align: left; box-shadow: none; border: .5pt solid #d2d2d7; }
}
@media (forced-colors: active) {
  .bq-fill { display: none; }
  .bq-card { margin-top: 16px; border: 1px solid CanvasText; }
}
