:root {
  --fondo: #f5f6f8;
  --hoja: #ffffff;
  --tinta: #1d2433;
  --suave: #5b6476;
  --linea: #d9dde5;
  --acento: #1f4fd8;
  --sobre-acento: #ffffff;
  --alerta: #b42318;
  --alerta-fondo: #fdecea;
  --bien: #146c43;
  --bien-fondo: #e6f4ec;
  --texto: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --documento: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fondo); color: var(--tinta); font: 16px/1.5 var(--texto); }
.marco {
  max-width: 760px; margin: 0 auto;
  padding-block: 24px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 16px;
}
.eyebrow { margin: 0; color: var(--suave); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
h1 { margin: 4px 0 0; font-size: clamp(22px, 5vw, 28px); line-height: 1.2; text-wrap: balance; }
.para { margin: 6px 0 0; color: var(--suave); }
.aviso { margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--alerta-fondo); color: var(--alerta); font-weight: 600; }
.guia { margin: 0 0 8px; color: var(--suave); }
.documento {
  background: var(--hoja); border: 1px solid var(--linea); border-radius: 12px;
  padding: 20px; font: 16px/1.6 var(--documento); overflow-wrap: anywhere;
}
.documento h1 { font-size: 20px; margin: 0 0 12px; }
.documento h2 { font-size: 17px; margin: 22px 0 6px; }
.documento p, .documento li { margin: 6px 0; }
.documento blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--linea); color: var(--suave); }
.documento hr { border: 0; border-top: 1px solid var(--linea); margin: 20px 0; }
.documento table { width: 100%; border-collapse: collapse; font: 14px/1.4 var(--texto); }
.documento th, .documento td { border-top: 1px solid var(--linea); padding: 8px 6px; text-align: left; vertical-align: top; }
.tabla { overflow-x: auto; }
.firma-img { max-width: 100%; height: 64px; object-fit: contain; display: block; }
.pend { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--fondo); color: var(--suave); font-size: 13px; }
.pend.tuya { background: #e8eefc; color: var(--acento); font-weight: 600; }
.firma { background: var(--hoja); border: 1px solid var(--linea); border-radius: 12px; padding: 20px; display: grid; gap: 12px; }
.firma h2 { margin: 0; font-size: 19px; }
.acepto { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.acepto input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--acento); }
.ayuda { margin: 0; color: var(--suave); font-size: 14px; }
.lienzo-caja { position: relative; border: 2px dashed var(--linea); border-radius: 12px; background: #fcfcfd; }
#lienzo { display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair; }
.linea { position: absolute; left: 24px; right: 24px; bottom: 44px; border-top: 1px solid var(--linea); pointer-events: none; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; }
button { font: 600 16px var(--texto); border-radius: 10px; padding: 12px 18px; min-height: 48px; cursor: pointer; border: 1px solid var(--linea); }
.primario { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); flex: 1; }
.secundario { background: var(--hoja); color: var(--tinta); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, .acepto input:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
.huella { margin: 0; font-size: 12px; color: var(--suave); overflow-wrap: anywhere; }
.listo { background: var(--bien-fondo); color: var(--bien); border-radius: 12px; padding: 20px; }
.listo h2 { margin: 0 0 6px; }
.listo p { margin: 0; color: var(--tinta); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
