/* Calculadoras web y vocabulario de escuadra.pro — mismo estilo que el sitio y la app:
   negro sobre blanco + amarillo obra, campos grandes para el dedo y alto contraste al sol. */

.calc-page { max-width: 980px; }
.calc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin: 24px 0 8px; }
.calc { border: 3px solid var(--k); border-radius: 16px; padding: 18px; background: #fff; }
.calc fieldset { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.calc legend, .fld-l { display: block; font-weight: 900; font-size: 16px; margin-bottom: 6px; }
.fld { display: block; margin-bottom: 14px; }
.fld input {
  width: 100%; font: inherit; font-size: 20px; font-weight: 800; color: var(--k);
  min-height: 54px; padding: 10px 14px; border: 2px solid var(--k); border-radius: 12px; background: #fff;
}
.fld input::placeholder { color: #8a8a8a; font-weight: 600; }
.fld input:focus { outline: 3px solid var(--y); outline-offset: 1px; }
.fld input[aria-invalid='true'] { border-color: #b00020; }
.fld-echo { display: block; min-height: 20px; font-size: 14px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.fld-echo.bad { color: #b00020; }
.fld-opt { font-weight: 600; color: var(--muted); font-size: 14px; }

/* Botones tipo pastilla (modos y opciones) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 56px;
  padding: 8px 14px; border: 2px solid var(--k); border-radius: 10px; font-weight: 900; font-size: 15px; background: #fff;
}
.seg input:checked + span { background: var(--k); color: var(--y); }
.seg input:focus-visible + span { outline: 3px solid #1461c4; outline-offset: 2px; }
.calc .modes { margin-bottom: 16px; }
.calc .modes span { font-size: 16px; }

/* Teclas rápidas para escribir medidas */
.ins { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.ins button {
  font: inherit; font-weight: 900; font-size: 16px; min-width: 44px; min-height: 40px; padding: 4px 10px;
  border: 2px solid var(--k); border-radius: 8px; background: var(--y-soft); color: var(--k); cursor: pointer;
}

/* Resultado */
.calc-out { position: sticky; top: 92px; }
.calc-out .out-hint { border: 2px dashed var(--k); border-radius: 16px; padding: 22px; font-weight: 800; color: var(--muted); margin: 0; }
.out-card { border: 3px solid var(--k); border-radius: 16px; background: var(--y-soft); padding: 18px; }
.calc-out .out-title { margin: 0; font-weight: 900; font-size: 14px; letter-spacing: .5px; text-transform: uppercase; }
.calc-out .out-main { margin: 2px 0 2px; font-weight: 900; font-size: clamp(32px, 5vw, 42px); line-height: 1.1; overflow-wrap: anywhere; }
.calc-out .out-cap { margin: 0 0 10px; line-height: 1.4; font-weight: 700; color: var(--muted); font-size: 15px; }
.calc-out .out-warn { margin: 6px 0; font-size: 16px; font-weight: 800; color: #b00020; }
.out-rows { border-top: 2px solid var(--k); margin-top: 8px; }
.out-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #e0d9b8; font-size: 16px; }
.out-row span { color: var(--muted); font-weight: 700; }
.out-row b { text-align: right; }
.out-row.strong span { color: var(--k); }
.out-row.strong b { font-size: 18px; }
.out-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn.small { font-size: 15px; padding: 10px 14px; border-width: 2px; }

/* Ejemplos */
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 0; }
.examples button {
  font: inherit; font-size: 15px; font-weight: 800; padding: 8px 12px; border: 2px solid var(--k);
  border-radius: 999px; background: #fff; cursor: pointer; color: var(--k);
}

/* Tarjetas de calculadoras */
.calc-cards { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 22px 0; }
.calc-card { display: block; text-decoration: none; border: 3px solid var(--k); border-radius: 16px; padding: 18px; background: #fff; }
.calc-card:hover { background: var(--y-soft); }
.calc-card strong { display: block; font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.calc-card span { color: var(--muted); font-weight: 600; font-size: 15px; }
.calc-card.dark { background: var(--k); color: #fff; }
.calc-card.dark span { color: #d9d9d9; }
.calc-link { background: var(--y); border: 2px solid var(--k); border-radius: 12px; padding: 14px 16px; font-weight: 800; margin-top: 28px; }
.calc-link a { font-weight: 900; }

/* Vocabulario */
.vocab-search { padding: 10px 0; }
.vocab-search input {
  width: 100%; font: inherit; font-size: 18px; font-weight: 700; min-height: 52px; padding: 10px 14px;
  border: 2px solid var(--k); border-radius: 12px;
}
.vocab-count { font-size: 14px; font-weight: 700; color: var(--muted); min-height: 20px; display: block; }
.guide table.vocab td:first-child, .guide table.vocab th:first-child { width: 50%; }
.guide table.vocab td:last-child { font-weight: 800; }
.guide table.vocab small { display: block; font-weight: 600; color: var(--muted); font-size: 13px; }

/* Cinta métrica (guía) */
.ruler { margin: 22px 0; }
.ruler svg { display: block; width: 100%; height: auto; }
.ruler figcaption { font-size: 15px; font-weight: 700; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* Índice de calculadoras por grupos */
.calc-page section .calc-cards { margin: 14px 0 8px; }

/* Sección de calculadoras en el inicio */
.home-calcs { border-top: 3px solid var(--k); }
.home-calcs .calc-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 860px) {
  .home-calcs .calc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .calc-wrap { grid-template-columns: minmax(0, 1fr); }
  .calc-out { position: static; }
}
@media (max-width: 480px) {
  .calc-card { padding: 14px; }
  .calc-card strong { font-size: 18px; }
  .calc-card span { font-size: 14px; }
  .calc { padding: 14px; }
}
