/* St. Patrick Tools (public_html/herramientas.php + herramientas.js) */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('../fonts/poppins-regular.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('../fonts/poppins-bold.woff2') format('woff2'); }

:root {
  --verde: #0e682f; --verde-profundo: #0a4a22; --lima: #95c01e; --lima-suave: #c9e37a;
  --texto: #17301f; --apagado: #5b6b5e; --borde: #e3e8df; --fondo: #f4f6f1; --blanco: #fff;
  --radio: 18px; --sombra: 0 10px 30px rgba(14, 104, 47, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--texto); background: var(--fondo); min-height: 100vh; }
a { color: var(--verde); }
.m-0 { margin: 0; }
.ht-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Pantalla de acceso ---------- */
.ht-fuera { background: radial-gradient(120% 120% at 80% 0%, #1b8a45 0%, var(--verde) 45%, var(--verde-profundo) 100%); }
.ht-acceso { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.ht-acceso-tarjeta { width: 100%; max-width: 430px; background: var(--blanco); border-radius: 28px; padding: 2.2rem 2rem 1.8rem; text-align: center; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35); }
.ht-acceso-logo { height: 46px; margin-bottom: 1.2rem; }
.ht-candado { width: 64px; height: 64px; margin: 0 auto 0.8rem; border-radius: 20px; display: grid; place-items: center; background: #e6f2da; color: var(--verde); font-size: 1.9rem; }
.ht-acceso h1 { margin: 0 0 0.4rem; font-size: 1.7rem; }
.ht-acceso h1 span, .ht-marca b { color: var(--lima); }
.ht-acceso p { margin: 0 0 1.3rem; color: var(--apagado); font-size: 0.95rem; line-height: 1.5; }
.ht-acceso-form { display: grid; gap: 0.8rem; }
.ht-clave { width: 100%; font: 700 1.35rem/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.18em; text-align: center; text-transform: uppercase; padding: 1rem; border: 2px solid var(--borde); border-radius: 14px; color: var(--texto); background: #fafbf8; }
.ht-clave:focus { outline: none; border-color: var(--verde); background: #fff; box-shadow: 0 0 0 4px rgba(14, 104, 47, 0.12); }
.ht-boton { --b: var(--verde); display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 48px; padding: 0.8rem 1.5rem; border: 0; border-radius: 999px; background: var(--b); color: #fff; font: 700 1rem/1.2 'Poppins', sans-serif; cursor: pointer; text-decoration: none; box-shadow: 0 6px 16px color-mix(in srgb, var(--b) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.18); transition: background 0.2s, transform 0.15s, box-shadow 0.2s, filter 0.2s; }
.ht-boton i { font-size: 1.15em; line-height: 1; }
.ht-boton:hover { filter: brightness(0.92); transform: translateY(-2px); box-shadow: 0 10px 22px color-mix(in srgb, var(--b) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.ht-boton:active { transform: translateY(0); box-shadow: 0 3px 8px color-mix(in srgb, var(--b) 30%, transparent); }
.ht-boton:focus-visible { outline: 3px solid color-mix(in srgb, var(--b) 45%, #fff); outline-offset: 3px; }
.ht-boton:disabled { opacity: 0.55; cursor: default; transform: none; filter: none; box-shadow: none; }
.ht-boton-sec { --b: #e6f2da; color: var(--verde); box-shadow: none; }
.ht-boton-sec:hover { --b: #d6eac2; filter: none; box-shadow: none; }
.ht-error { display: flex; gap: 0.5rem; align-items: flex-start; text-align: left; padding: 0.75rem 0.9rem; border-radius: 12px; background: #fee2e2; color: #991b1b; font-size: 0.9rem; }
.ht-acceso-nota { margin: 1.2rem 0 0.4rem !important; font-size: 0.85rem !important; }
.ht-volver { display: inline-flex; gap: 0.35rem; align-items: center; font-size: 0.85rem; color: var(--apagado); text-decoration: none; }

/* ---------- Barra ---------- */
.ht-barra { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 1.3rem; background: var(--verde-profundo); color: #fff; }
.ht-marca { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; font-size: 1.1rem; }
.ht-marca img { height: 38px; width: auto; display: block; }
.ht-marca-tools { padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--lima); color: var(--verde-profundo); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.ht-barra-der { display: flex; align-items: center; gap: 0.6rem; }
.ht-privado { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--lima-suave); }
.ht-barra-boton { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: #fff; font: 600 0.85rem 'Poppins', sans-serif; text-decoration: none; cursor: pointer; }
.ht-barra-boton:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Cuadritos ---------- */
.ht-contenedor { max-width: 1180px; margin: 0 auto; padding: 2rem 1.3rem 4rem; }
.ht-portada { text-align: center; padding: 1.5rem 0 1rem; }
.ht-portada h1 { margin: 0 0 0.5rem; font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.ht-portada p { margin: 0 auto; max-width: 640px; color: var(--apagado); }
.ht-portada h1 span { display: inline-block; padding: 0 0.45em; border-radius: 0.45em; background: var(--lima); color: var(--verde-profundo); }
.ht-categoria { margin: 2.2rem 0 1rem; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--apagado); }
.ht-cuadritos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.ht-cuadrito { display: flex; flex-direction: column; gap: 0.45rem; padding: 1.3rem 1.2rem; border-radius: var(--radio); background: var(--blanco); border: 1px solid var(--borde); text-decoration: none; color: var(--texto); box-shadow: var(--sombra); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.ht-cuadrito:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(14, 104, 47, 0.14); border-color: var(--ht-color); }
.ht-cuadrito-icono { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.55rem; color: #fff; background: var(--ht-color); flex: none; }
.ht-cuadrito strong { font-size: 1.05rem; margin-top: 0.3rem; }
.ht-cuadrito small { color: var(--apagado); font-size: 0.85rem; line-height: 1.45; }

/* ---------- Una herramienta ---------- */
.ht-herramienta { max-width: 980px; }
.ht-atras { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; }
.ht-encabezado { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.ht-encabezado h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.ht-encabezado p { margin: 0.2rem 0 0; color: var(--apagado); }
.ht-zona { position: relative; display: grid; place-items: center; gap: 0.6rem; padding: 3rem 1.5rem; border: 2.5px dashed color-mix(in srgb, var(--ht-color) 55%, #fff); border-radius: 24px; background: var(--blanco); text-align: center; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.ht-zona:hover, .ht-zona.arrastrando { background: color-mix(in srgb, var(--ht-color) 7%, #fff); border-color: var(--ht-color); }
.ht-zona input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ht-zona-icono { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; margin-bottom: 0.2rem; background: color-mix(in srgb, var(--ht-color) 12%, #fff); color: var(--ht-color); font-size: 2.2rem; transition: transform 0.25s; }
.ht-zona strong { font-size: 1.15rem; }
.ht-zona small { color: var(--apagado); }
.ht-zona .ht-zona-boton { --b: var(--ht-color); margin-top: 0.5rem; padding: 0.85rem 1.8rem; font-size: 1.05rem; pointer-events: none; }
.ht-zona:hover .ht-zona-boton, .ht-zona:focus-within .ht-zona-boton { filter: brightness(0.92); transform: translateY(-2px); box-shadow: 0 12px 24px color-mix(in srgb, var(--ht-color) 38%, transparent); }
.ht-zona:hover .ht-zona-icono, .ht-zona.arrastrando .ht-zona-icono { transform: translateY(-4px); }
.ht-zona:focus-within { outline: 3px solid color-mix(in srgb, var(--ht-color) 40%, #fff); outline-offset: 3px; }
.ht-zona-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.3rem; font-size: 0.8rem; color: var(--apagado); }
.ht-zona-formato { padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--fondo); border: 1px solid var(--borde); font-weight: 600; color: var(--texto); }
.ht-panel { margin-top: 1.2rem; padding: 1.2rem; background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); }
.ht-lista { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.ht-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid var(--borde); border-radius: 12px; background: #fafbf8; }
.ht-item i.bi-grip-vertical { color: var(--apagado); cursor: grab; }
.ht-item-nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.92rem; }
.ht-item small { color: var(--apagado); font-size: 0.8rem; white-space: nowrap; }
.ht-mini-boton { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--apagado); cursor: pointer; font-size: 1rem; }
.ht-mini-boton:hover { background: #eef2ea; color: var(--texto); }
.ht-opciones { display: grid; gap: 0.9rem; margin-top: 1rem; }
.ht-opcion label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.35rem; }
.ht-opcion input[type=text], .ht-opcion input[type=number], .ht-opcion select { width: 100%; padding: 0.7rem 0.85rem; border: 1.5px solid var(--borde); border-radius: 12px; font: 400 0.95rem 'Poppins', sans-serif; color: var(--texto); background: #fff; }
.ht-opcion small { display: block; color: var(--apagado); font-size: 0.8rem; margin-top: 0.3rem; }
.ht-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ht-chip { padding: 0.5rem 0.95rem; border: 1.5px solid var(--borde); border-radius: 999px; background: #fff; font: 600 0.85rem 'Poppins', sans-serif; color: var(--texto); cursor: pointer; }
.ht-chip.activo { background: var(--ht-color); border-color: var(--ht-color); color: #fff; }
.ht-acciones { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.ht-acciones .ht-boton:not(.ht-boton-sec), .ht-listo .ht-boton:not(.ht-boton-sec) { --b: var(--ht-color); }
.ht-progreso { margin-top: 1rem; }
.ht-progreso span { display: block; height: 8px; border-radius: 8px; background: #e9eee4; overflow: hidden; }
.ht-progreso b { display: block; height: 100%; width: 0; background: var(--ht-color); transition: width 0.2s; }
.ht-progreso small { display: block; margin-top: 0.35rem; color: var(--apagado); font-size: 0.85rem; }
.ht-listo { margin-top: 1rem; padding: 1.2rem; border-radius: var(--radio); background: #ecf7e4; border: 1px solid #cfe7bd; display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; }
.ht-listo i.bi-check-circle-fill { font-size: 1.8rem; color: #2e9e4f; }
.ht-listo div { flex: 1; min-width: 200px; }
.ht-listo strong { display: block; }
.ht-listo small { color: var(--apagado); }

/* Páginas en miniatura (organizar, girar, extraer) */
.ht-paginas { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.9rem; }
.ht-pagina { position: relative; border: 2px solid var(--borde); border-radius: 12px; background: #fff; padding: 0.4rem; cursor: pointer; user-select: none; transition: border-color 0.15s, transform 0.15s, opacity 0.15s; }
.ht-pagina canvas, .ht-pagina img { display: block; width: 100%; height: auto; border-radius: 6px; background: #f3f3f3; transition: transform 0.25s; }
.ht-pagina-num { display: block; text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--apagado); margin-top: 0.3rem; }
.ht-pagina.seleccionada { border-color: var(--ht-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ht-color) 25%, transparent); }
.ht-pagina.seleccionada::after { content: '\2713'; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--ht-color); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; }
.ht-pagina.borrada { opacity: 0.3; }
.ht-pagina.arrastrando { opacity: 0.4; transform: scale(0.96); }
.ht-pagina-botones { position: absolute; left: 0; right: 0; bottom: 1.9rem; display: flex; justify-content: center; gap: 0.3rem; opacity: 0; transition: opacity 0.15s; }
.ht-pagina:hover .ht-pagina-botones, .ht-pagina:focus-within .ht-pagina-botones { opacity: 1; }
.ht-pagina-botones button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(23, 48, 31, 0.85); color: #fff; cursor: pointer; }
.ht-privado-nota { margin-top: 2rem; text-align: center; color: var(--apagado); font-size: 0.85rem; }
.ht-texto { width: 100%; min-height: 280px; padding: 1rem; border: 1.5px solid var(--borde); border-radius: 12px; font: 400 0.9rem/1.5 ui-monospace, Menlo, monospace; }

@media (max-width: 640px) {
  .ht-privado span, .ht-barra-boton span { display: none; }
  .ht-cuadritos { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .ht-cuadrito { padding: 1rem 0.85rem; }
  .ht-cuadrito small { display: none; }
  .ht-zona { padding: 2rem 1rem; }
  .ht-pagina-botones { opacity: 1; }
  .ht-acciones .ht-boton { flex: 1 1 100%; }
}

/* Herramientas con vista de página, firma, recorte, Word/Excel y QR */
.ht-paso { margin: 1rem 0 0.6rem; font-weight: 700; font-size: 0.95rem; }
.ht-ayuda { display: block; color: var(--apagado); font-size: 0.85rem; line-height: 1.45; }
.ht-check { display: flex; align-items: center; gap: 0.5rem; margin: 0.7rem 0 0; font-size: 0.92rem; cursor: pointer; }
.ht-check input { width: 18px; height: 18px; accent-color: var(--ht-color); }
.ht-rejilla4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.ht-colocar { margin-top: 0.4rem; }
.ht-colocar-nav { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.ht-colocar-pag { font-weight: 700; font-size: 0.88rem; min-width: 110px; text-align: center; }
.ht-colocar-tam { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto; color: var(--apagado); }
.ht-colocar-tam input { width: 160px; accent-color: var(--ht-color); }
.ht-colocar-hoja { position: relative; max-width: 760px; margin: 0 auto; border: 1px solid var(--borde); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12); touch-action: none; }
.ht-colocar-hoja canvas { display: block; }
.ht-colocar-encima { position: absolute; cursor: grab; outline: 2px dashed var(--ht-color); outline-offset: 2px; touch-action: none; user-select: none; }
.ht-colocar-encima:active { cursor: grabbing; }
img.ht-colocar-encima { height: auto; background: transparent; }
.ht-texto-encima { white-space: nowrap; line-height: 1; padding: 2px; color: #111; font-family: Helvetica, Arial, sans-serif; width: auto !important; }
.ht-firma-lienzo { display: block; width: 100%; max-width: 620px; aspect-ratio: 3 / 1; border: 2px dashed var(--borde); border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; }
.ht-firma-vista { visibility: hidden; }
.ht-docx { max-height: 70vh; overflow: auto; background: #e9ece6; border-radius: 12px; padding: 0.6rem; }
.ht-docx .docx-wrapper { background: transparent !important; padding: 0 !important; }
.ht-docx section.docx { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); margin: 0 auto 0.8rem !important; }
.ht-excel { max-height: 70vh; overflow: auto; margin-top: 1rem; }
.ht-excel-hoja { background: #fff; padding: 0.5rem; margin: 0.4rem 0 1rem; overflow: auto; }
.ht-excel-hoja table { border-collapse: collapse; font: 12px Arial, sans-serif; }
.ht-excel-hoja td, .ht-excel-hoja th { border: 1px solid #c9cfc4; padding: 3px 6px; white-space: nowrap; }
.ht-recorte { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; }
.ht-recorte img { display: block; max-width: 100%; max-height: 65vh; }
.ht-recorte-sel { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); cursor: move; touch-action: none; }
.ht-recorte-asa { position: absolute; right: -9px; bottom: -9px; width: 20px; height: 20px; border-radius: 50%; background: var(--ht-color); border: 3px solid #fff; cursor: nwse-resize; }
.ht-recorte { overflow: hidden; border-radius: 8px; }
.ht-qr { display: block; width: 100%; max-width: 320px; margin: 1rem auto 0; border-radius: 12px; border: 1px solid var(--borde); }
@media (max-width: 640px) {
  .ht-rejilla4 { grid-template-columns: 1fr 1fr; }
  .ht-colocar-tam { margin-left: 0; width: 100%; }
  .ht-colocar-tam input { flex: 1; }
}

/* Calculadoras */
.ht-calc h3, .ht-panel h3 { margin: 0 0 0.8rem; font-size: 1.05rem; }
.ht-calc + .ht-calc, .ht-panel + .ht-panel { margin-top: 1rem; }
.ht-calc-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ht-calc-fila input[type=text], .ht-calc-fila input[type=date], .ht-calc-fila select, .ht-rubro input { padding: 0.7rem 0.85rem; border: 1.5px solid var(--borde); border-radius: 12px; font: 600 1rem 'Poppins', sans-serif; color: var(--texto); background: #fff; min-width: 0; }
.ht-calc-fila input[type=text] { width: 130px; }
.ht-calc-fila span { color: var(--apagado); font-weight: 600; }
.ht-resultado { margin-top: 0.9rem; padding: 0.9rem 1.1rem; border-radius: 14px; background: color-mix(in srgb, var(--ht-color) 10%, #fff); color: var(--texto); font-weight: 700; font-size: 1.15rem; }
.ht-calculadora { max-width: 460px; margin: 0 auto; }
.ht-calc-pantalla { width: 100%; padding: 0.9rem 1rem; border: 0; border-radius: 14px; background: #17301f; color: #fff; font: 600 1.6rem ui-monospace, Menlo, monospace; text-align: right; }
.ht-calc-res { min-height: 2rem; margin: 0.4rem 0 0.8rem; text-align: right; font: 700 1.5rem 'Poppins', sans-serif; color: var(--ht-color); overflow-wrap: anywhere; }
.ht-calc-res.err { font-size: 0.9rem; color: #b91c1c; }
.ht-calc-teclas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
.ht-tecla { padding: 0.9rem 0; border: 0; border-radius: 14px; background: #eef2ea; font: 700 1.1rem 'Poppins', sans-serif; color: var(--texto); cursor: pointer; transition: transform 0.08s, background 0.15s; }
.ht-tecla:active { transform: scale(0.95); }
.ht-tecla:hover { background: #e2e9dc; }
.ht-tecla.op { background: color-mix(in srgb, var(--ht-color) 18%, #fff); color: var(--ht-color); }
.ht-tecla.igual { background: var(--ht-color); color: #fff; }
.ht-tecla.borrar { background: #fee2e2; color: #b91c1c; }
.ht-calc-hist { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.ht-calc-hist li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--borde); font-family: ui-monospace, Menlo, monospace; }
.ht-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; }
.ht-stat { padding: 0.75rem 0.9rem; border-radius: 12px; background: #fafbf8; border: 1px solid var(--borde); }
.ht-stat small { display: block; color: var(--apagado); font-size: 0.78rem; }
.ht-stat strong { font-size: 1.15rem; }
.ht-grafica { width: 100%; height: auto; }
.ht-rubro { display: grid; grid-template-columns: 1fr 80px 18px 100px 34px; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
.ht-rubro-titulos small { color: var(--apagado); font-weight: 700; }

/* Editor de fotos */
.ht-editor { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.ht-editor-escenario { background: repeating-conic-gradient(#e9ece6 0% 25%, #fff 0% 50%) 50% / 20px 20px; border-radius: var(--radio); padding: 0.6rem; border: 1px solid var(--borde); position: sticky; top: 80px; }
.ht-editor-escenario.dibujando .ht-editor-lienzo { cursor: crosshair; touch-action: none; }
.ht-editor-lienzo { display: block; width: 100%; height: auto; border-radius: 8px; }
.ht-editor-controles { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem; }
.ht-editor-controles h3 { margin: 1rem 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--apagado); }
.ht-editor-controles h3:first-child { margin-top: 0; }
.ht-deslizador { display: grid; gap: 0.2rem; margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 600; }
.ht-deslizador input { width: 100%; accent-color: var(--ht-color); }
.ht-editor-controles input[type=color] { width: 44px; height: 40px; border: 0; padding: 0; background: none; }

/* Para el salón */
.ht-sorteo { margin: 0.5rem 0 1rem; font: 700 clamp(2rem, 7vw, 4rem) 'Poppins', sans-serif; color: var(--ht-color); min-height: 1.3em; transition: transform 0.2s; }
.ht-sorteo.ganador { transform: scale(1.15); }
.ht-equipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.6rem; margin-top: 1rem; }
.ht-equipo { padding: 0.8rem; border-radius: 12px; background: #fafbf8; border: 1px solid var(--borde); }
.ht-equipo ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.ht-reloj-caja { text-align: center; }
.ht-reloj-caja:fullscreen { display: grid; place-content: center; background: #0a4a22; }
.ht-reloj-caja:fullscreen .ht-reloj { color: #fff; font-size: 22vw; }
.ht-reloj { font: 700 clamp(3.5rem, 16vw, 9rem)/1 ui-monospace, Menlo, monospace; color: var(--texto); letter-spacing: 0.02em; }
.ht-reloj.fin { color: #e5322d; animation: ht-parpadeo 0.6s steps(2) 6; }
@keyframes ht-parpadeo { 50% { opacity: 0.2; } }

@media (max-width: 860px) {
  .ht-editor { grid-template-columns: 1fr; }
  .ht-editor-escenario { position: static; }
  .ht-rubro { grid-template-columns: 1fr 64px 14px 76px 34px; }
}

/* Campos de contraseña con ojito y medidor */
.ht-opcion input[type=password], .ht-opcion input[type=date] { width: 100%; padding: 0.7rem 0.85rem; border: 1.5px solid var(--borde); border-radius: 12px; font: 400 0.95rem 'Poppins', sans-serif; color: var(--texto); background: #fff; }
.ht-clave-caja { position: relative; }
.ht-clave-caja input { width: 100%; padding: 0.8rem 3.2rem 0.8rem 0.95rem; border: 1.5px solid var(--borde); border-radius: 12px; font: 600 1.05rem ui-monospace, Menlo, monospace; letter-spacing: 0.04em; color: var(--texto); background: #fff; }
.ht-clave-caja input:focus, .ht-opcion input:focus, .ht-opcion select:focus, .ht-calc-fila input:focus { outline: none; border-color: var(--ht-color, var(--verde)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ht-color, #0e682f) 15%, transparent); }
.ht-ojo { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--apagado); font-size: 1.2rem; cursor: pointer; }
.ht-ojo:hover { background: #eef2ea; color: var(--texto); }
.ht-generar { margin-top: 0.55rem; padding: 0.55rem 1rem; font-size: 0.85rem; }
.ht-fuerza { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.45rem; }
.ht-fuerza span { flex: 1; height: 6px; border-radius: 6px; background: #e9eee4; overflow: hidden; }
.ht-fuerza b { display: block; height: 100%; width: 0; transition: width 0.25s, background 0.25s; }
.ht-fuerza small { min-width: 60px; font-weight: 700; font-size: 0.8rem; color: var(--apagado); }

/* Gráficas profesionales (Estadísticas) */
.ht-graficas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.ht-grafica-caja { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1rem 1.1rem 0.8rem; min-width: 0; }
.ht-grafica-caja:first-child, .ht-grafica-caja:nth-child(2) { grid-column: 1 / -1; }
.ht-grafica-titulo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; margin-bottom: 0.6rem; }
.ht-grafica-titulo strong { font-size: 1.02rem; }
.ht-grafica-titulo small { color: var(--apagado); font-size: 0.8rem; }
.ht-grafica-lienzo { position: relative; }
.ht-grafica-lienzo canvas { display: block; }
.ht-tip { position: absolute; z-index: 2; pointer-events: none; padding: 0.45rem 0.65rem; border-radius: 10px; background: rgba(23, 48, 31, 0.94); color: #fff; font-size: 0.8rem; line-height: 1.35; white-space: nowrap; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.ht-stat small { display: flex; align-items: center; gap: 0.3rem; }
.ht-stat small i { color: var(--ht-color); }
@media (max-width: 760px) { .ht-graficas { grid-template-columns: 1fr; } }

/* Ruleta */
.ht-ruleta-escenario { text-align: center; }
.ht-ruleta-escenario:fullscreen { display: grid; place-content: center; background: radial-gradient(circle at 50% 30%, #1b8a45, #0a4a22); color: #fff; }
.ht-ruleta-escenario:fullscreen .ht-sorteo { color: #fff; }
.ht-ruleta-caja { position: relative; display: flex; justify-content: center; }
.ht-ruleta { display: block; max-width: 100%; cursor: pointer; }
.ht-ruleta-escenario:fullscreen .ht-ruleta-caja { width: min(80vh, 90vw); margin: 0 auto; }
.ht-confeti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ht-sorteo { margin: 0.8rem 0 0.4rem; }
.ht-sorteo.ganador { animation: ht-salto 0.6s ease; }
@keyframes ht-salto { 0% { transform: scale(0.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1.08); } }
.ht-boton-grande { padding: 1.05rem 2.2rem; font-size: 1.15rem; }
.ht-historial-sorteo { margin: 0; padding-left: 1.4rem; columns: 3 140px; }
.ht-historial-sorteo li { margin-bottom: 0.2rem; font-weight: 600; }
.ht-equipo { border-top: 4px solid var(--eq, var(--verde)); }

/* ---------- QR con diseño ---------- */
.ht-qr-diseno { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; margin-top: 1.2rem; }
.ht-qr-diseno > .ht-panel { margin-top: 0; }
.ht-qr-vista { position: sticky; top: 84px; display: grid; gap: 0.7rem; }
.ht-qr-vista .ht-boton { width: 100%; }
.ht-qr-lienzo { display: grid; place-items: center; min-height: 260px; padding: 12px; border-radius: 18px; border: 1px solid var(--borde); background: repeating-conic-gradient(#eef1ea 0 25%, #fff 0 50%) 0 0 / 18px 18px; }
.ht-qr-lienzo canvas { display: block; width: 100%; height: auto; max-width: 300px; filter: drop-shadow(0 8px 18px rgba(14, 104, 47, 0.12)); }
.ht-qr-vacio { margin: 0; color: var(--apagado); font-size: 0.9rem; text-align: center; }
.ht-qr-aviso { padding: 0.7rem 0.85rem; border-radius: 12px; background: #fff6e0; border: 1px solid #f3dc9b; color: #7a5300; font-size: 0.85rem; line-height: 1.45; }
.ht-qr-nota { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0; font-size: 0.82rem; color: var(--apagado); }
.ht-qr-nota i { color: var(--verde); }
.ht-qr-seccion + .ht-qr-seccion { margin-top: 1.4rem; padding-top: 1.3rem; border-top: 1px solid var(--borde); }
.ht-qr-seccion h3 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.8rem; font-size: 1rem; }
.ht-qr-seccion h3 b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ht-color); color: #fff; font-size: 0.8rem; }
.ht-qr-seccion > .ht-opcion, .ht-qr-seccion > .ht-colores-propios { margin-top: 0.9rem; }
.ht-qr-sub { display: block; margin: 0.4rem 0 0.4rem; font-weight: 700; font-size: 0.8rem; color: var(--apagado); text-transform: uppercase; letter-spacing: 0.06em; }
.ht-qr-sub + .ht-tiles + .ht-qr-sub { margin-top: 0.9rem; }
.ht-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 0.5rem; }
.ht-tile { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.6rem 0.35rem 0.55rem; border: 1.5px solid var(--borde); border-radius: 14px; background: #fff; font: 600 0.74rem/1.2 'Poppins', sans-serif; color: var(--texto); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.ht-tile canvas { width: 56px; height: 56px; }
.ht-tile:hover { border-color: color-mix(in srgb, var(--ht-color) 50%, #fff); transform: translateY(-2px); }
.ht-tile.activo { border-color: var(--ht-color); background: color-mix(in srgb, var(--ht-color) 6%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ht-color) 18%, transparent); }
.ht-tile:focus-visible, .ht-swatch:focus-visible { outline: 3px solid color-mix(in srgb, var(--ht-color) 45%, #fff); outline-offset: 2px; }
.ht-swatches { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.ht-swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--borde); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.ht-swatch:hover { transform: scale(1.08); }
.ht-swatch.activo { box-shadow: 0 0 0 3px var(--ht-color); }
.ht-colores-propios { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 0.88rem; color: var(--apagado); }
.ht-colores-propios .ht-check { margin: 0; color: var(--texto); }
.ht-colores-propios input[type=color] { width: 46px; height: 38px; padding: 3px; border: 1.5px solid var(--borde); border-radius: 10px; background: #fff; cursor: pointer; }
.ht-colores-propios input[type=color][hidden] { display: none; }
.ht-opcion textarea { width: 100%; padding: 0.7rem 0.85rem; border: 1.5px solid var(--borde); border-radius: 12px; font: 400 0.95rem 'Poppins', sans-serif; color: var(--texto); background: #fff; resize: vertical; }
.ht-opcion[hidden] { display: none; }
@media (max-width: 860px) {
  .ht-qr-diseno { grid-template-columns: 1fr; }
  .ht-qr-vista { position: static; order: -1; }
}
