/* herramientas.css — piezas de interfaz compartidas por la plataforma:
   calculadora, formulario, aula, panel del profe y portal del alumno.
   Mundo «cuaderno»: papel, tinta azul, grafito, resaltador amarillo y corrección en rojo.
   Requiere base.css. Todas las clases empiezan con «h-». */

.h-lienzo { background: var(--papel); color: var(--grafito); min-height: 100svh; }
.h-titulo { font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.04; letter-spacing: -.01em; }
.h-subtitulo { font-family: var(--serif); font-weight: 700; font-size: 23px; line-height: 1.15; }
.h-rotulo { font-size: 13.5px; font-weight: 600; letter-spacing: .02em; color: var(--grafito-70); }
.h-nota { font-size: 14.5px; color: var(--grafito-70); line-height: 1.45; }
.h-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.h-mano { font-family: var(--mano); font-size: 1.35em; line-height: 1; color: var(--rojo); }

/* barra superior común de la plataforma
   <header class="h-barra"><a class="h-sello" href="/" aria-label="Clara Aráoz, inicio"><span>c<i>a</i></span></a>
   <span class="h-barra__titulo">Calculadora</span><div class="h-barra__fin">…botones…</div></header> */
.h-barra { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px clamp(14px, 3vw, 32px); background: rgba(247, 243, 233, .93); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--grafito-12); }
.h-sello { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--pizarron); color: var(--tiza); font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 21px; line-height: 1; text-decoration: none; flex: none; }
.h-sello span { transform: translateY(-1.5px); }
.h-sello i { color: var(--amarillo); }
.h-barra__titulo { font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1.1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-barra__fin { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* tarjeta: hoja blanca apoyada sobre el papel */
.h-tarjeta { background: var(--blanco); border: 1px solid var(--grafito-12); border-radius: var(--radio); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 14px 30px -24px rgba(29, 33, 37, .35); padding: 20px; }
.h-tarjeta--plana { box-shadow: none; }

/* filas y grillas simples */
.h-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.h-fila--entre { justify-content: space-between; }
.h-pila { display: flex; flex-direction: column; gap: 14px; }
.h-crece { flex: 1 1 0; min-width: 0; }

/* botones de herramienta (los grandes de la web son .boton en base.css) */
.h-boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 11px; font-size: 15.5px; font-weight: 600; white-space: nowrap; text-decoration: none; background: var(--blanco); color: var(--grafito); box-shadow: 0 0 0 1px var(--grafito-12) inset, 0 1px 0 rgba(29, 33, 37, .06); transition: background-color .15s, box-shadow .15s, transform .15s, color .15s; }
.h-boton:hover { box-shadow: 0 0 0 1px var(--grafito-45) inset; }
.h-boton:active { transform: translateY(1px); }
.h-boton[disabled] { opacity: .45; pointer-events: none; }
.h-boton--tinta { background: var(--tinta); color: #fff; box-shadow: 0 8px 18px -12px rgba(28, 63, 174, .9); }
.h-boton--tinta:hover { background: #17358f; box-shadow: 0 8px 18px -10px rgba(28, 63, 174, .9); }
.h-boton--amarillo { background: var(--amarillo); color: #1b1a12; box-shadow: 0 0 0 1px rgba(27, 26, 18, .12) inset; }
.h-boton--amarillo:hover { background: #ffe56f; }
.h-boton--suave { background: transparent; box-shadow: none; color: var(--tinta); padding: 0 10px; }
.h-boton--suave:hover { background: rgba(28, 63, 174, .08); box-shadow: none; }
.h-boton--chico { min-height: 36px; padding: 0 12px; font-size: 14.5px; border-radius: 9px; }
.h-boton--icono { width: 44px; padding: 0; }
.h-boton svg { width: 19px; height: 19px; flex: none; }
.h-boton[aria-pressed="true"], .h-boton.es-activo { background: var(--grafito); color: var(--papel); box-shadow: none; }

/* solapas */
.h-fichas { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; background: var(--papel-hondo); border-radius: 13px; }
.h-fichas::-webkit-scrollbar { display: none; }
.h-ficha { flex: none; min-height: 40px; padding: 0 15px; border-radius: 10px; font-size: 15.5px; font-weight: 600; color: var(--grafito-70); white-space: nowrap; transition: background-color .15s, color .15s; }
.h-ficha:hover { color: var(--grafito); }
.h-ficha[aria-selected="true"] { background: var(--blanco); color: var(--grafito); box-shadow: 0 1px 2px rgba(29, 33, 37, .16); }

/* campos */
.h-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.h-campo > span, .h-campo > label { font-size: 13.5px; font-weight: 600; color: var(--grafito-70); }
.h-entrada, .h-area, .h-selector { width: 100%; min-height: 46px; padding: 10px 13px; border: 0; border-radius: 11px; background: var(--blanco); color: var(--grafito); box-shadow: 0 0 0 1px var(--grafito-45) inset; font-size: 16.5px; transition: box-shadow .15s; }
.h-entrada::placeholder, .h-area::placeholder { color: var(--grafito-45); }
.h-entrada:focus, .h-area:focus, .h-selector:focus { outline: none; box-shadow: 0 0 0 2px var(--tinta) inset; }
.h-entrada--mate { font-family: var(--mono); font-size: 17px; letter-spacing: -.01em; }
.h-entrada.es-error { box-shadow: 0 0 0 2px var(--rojo) inset; }
.h-area { min-height: 96px; resize: vertical; line-height: 1.45; }
.h-deslizador { width: 100%; accent-color: var(--tinta); height: 30px; }
.h-casilla { display: inline-flex; align-items: center; gap: 9px; font-size: 15.5px; min-height: 40px; cursor: pointer; }
.h-casilla input { width: 20px; height: 20px; accent-color: var(--tinta); }

/* resultado: lo que se resalta con amarillo */
.h-resultado { position: relative; padding: 16px 18px 16px 22px; border-radius: 12px; background: #fffbe6; box-shadow: 0 0 0 1px rgba(184, 148, 0, .28) inset; overflow-x: auto; }
.h-resultado::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 3px; background: var(--amarillo); }
.h-resultado .katex { font-size: 1.28em; }
.h-resultado--error { background: #fdf0ec; box-shadow: 0 0 0 1px rgba(210, 69, 47, .3) inset; color: #8a2414; }
.h-resultado--error::before { background: var(--rojo); }

/* pasos numerados, como en una carpeta */
.h-pasos { counter-reset: paso; display: flex; flex-direction: column; gap: 10px; }
.h-pasos > li { counter-increment: paso; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px dashed var(--grafito-12); }
.h-pasos > li:first-child { border-top: 0; }
.h-pasos > li::before { content: counter(paso); font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--tinta); }
.h-pasos .h-nota { display: block; margin-bottom: 4px; }

/* tablas */
.h-tabla { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.h-tabla th { text-align: left; font-size: 13.5px; font-weight: 600; color: var(--grafito-70); padding: 8px 10px; border-bottom: 1.5px solid var(--grafito-45); }
.h-tabla td { padding: 8px 10px; border-bottom: 1px solid var(--grafito-12); font-variant-numeric: tabular-nums; }
.h-tabla--num td { font-family: var(--mono); text-align: right; }

/* teclado en pantalla */
.h-teclado { display: grid; gap: 6px; }
.h-tecla { min-height: 46px; border-radius: 10px; background: var(--blanco); box-shadow: 0 0 0 1px var(--grafito-12) inset, 0 2px 0 rgba(29, 33, 37, .1); font-size: 18px; font-weight: 500; display: grid; place-items: center; transition: transform .08s, background-color .12s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.h-tecla:active { transform: translateY(2px); box-shadow: 0 0 0 1px var(--grafito-12) inset; }
.h-tecla--num { background: var(--grafito); color: var(--papel); box-shadow: 0 2px 0 #000; }
.h-tecla--op { background: var(--papel-hondo); }
.h-tecla--igual { background: var(--amarillo); color: #1b1a12; font-weight: 700; }
.h-tecla--borrar { background: #f6c8ba; color: #5a1a0c; }

/* etiquetas de estado */
.h-pastilla { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--papel-hondo); color: var(--grafito-70); white-space: nowrap; }
.h-pastilla--tinta { background: rgba(28, 63, 174, .1); color: var(--tinta); }
.h-pastilla--verde { background: rgba(31, 122, 85, .12); color: var(--verde); }
.h-pastilla--rojo { background: rgba(210, 69, 47, .12); color: var(--rojo); }
.h-pastilla--amarillo { background: #fff1a8; color: #5c4a00; }

.h-aviso { padding: 12px 14px; border-radius: 11px; background: rgba(28, 63, 174, .07); color: #1a2f78; font-size: 14.5px; line-height: 1.45; }
.h-vacio { padding: 26px 18px; text-align: center; color: var(--grafito-70); font-size: 15.5px; border: 1.5px dashed var(--grafito-45); border-radius: var(--radio); }

/* área de dibujo de gráficos */
.h-grafico { position: relative; border-radius: 12px; overflow: hidden; background: var(--blanco); box-shadow: 0 0 0 1px var(--grafito-12) inset; touch-action: none; }
.h-grafico canvas { width: 100%; height: 100%; }

@media (max-width: 640px) {
  .h-tarjeta { padding: 16px; }
  .h-ficha { padding: 0 12px; font-size: 15px; }
}
@media print {
  .h-no-imprimir { display: none !important; }
  .h-tarjeta { box-shadow: none; border-color: #999; }
}
