/* From Lab to Plant · Calculadora TEA. Usa los tokens de /styles.css (Brand Book v2):
   blanco, tinta y Petróleo como único color; filetes en lugar de tarjetas; radios de 2 px. */

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tea-col { max-width: 68ch; }

/* Intro */
.tea-intro .wrap { padding-top: 64px; padding-bottom: 32px; }
.tea-intro h1 { max-width: 20ch; }
.tea-intro .lead { max-width: 640px; }

/* Rejilla principal */
.tea-calc .wrap { padding-bottom: 64px; }
.tea-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
@media (min-width: 960px) {
  .tea-resultado { position: sticky; top: 16px; }
}
@media (max-width: 959px) {
  .tea-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Formulario */
.tea-form { display: flex; flex-direction: column; gap: 24px; }
#tea-campos { display: flex; flex-direction: column; gap: 32px; }
.tea-grupo { border: 0; margin: 0; padding: 16px 0 0; border-top: 2px solid var(--border-strong); display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tea-grupo > legend, .tea-opciones > legend {
  padding: 0; font-family: var(--font-ui); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
}
.tea-grupo > legend { float: left; width: 100%; margin-bottom: 4px; }
.tea-grupo > legend + * { clear: both; }
.tea-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tea-campo > label { font-family: var(--font-ui); font-size: 15px; line-height: 22px; font-weight: 600; }
.tea-u { font-weight: 400; color: var(--muted); }
.tea-input { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 2px; background: var(--bg); }
.tea-input:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.tea-input:has(input[aria-invalid="true"]) { border-width: 2px; }
.tea-input input {
  flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0 12px; border: 0; background: transparent; color: var(--text);
  font-family: var(--font-mono); font-size: 16px; border-radius: 2px;
}
.tea-input--texto input { font-family: var(--font-ui); }
.tea-input input:focus { outline: none; }
.tea-input input::placeholder { color: var(--muted); opacity: 1; }
.tea-unidad { display: flex; align-items: center; padding: 0 12px; border-left: 1px solid var(--border); font-family: var(--font-mono); font-size: 14px; color: var(--muted); white-space: nowrap; }
.tea-ayuda { font-size: 14px; line-height: 22px; color: var(--muted); }
.tea-error { font-family: var(--font-ui); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text); }
.tea-error:empty { display: none; }
.tea-error::before { content: "Revisa: "; }
.tea-opciones { border: 0; margin: 0; padding: 0; gap: 8px; }
.tea-opciones > legend { margin-bottom: 8px; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--text); }
.tea-radio { display: flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-size: 15px; line-height: 22px; min-height: 32px; cursor: pointer; }
.tea-radio input, .tea-check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.tea-acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.tea-acciones .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }

/* Resultado */
.tea-resultado { display: flex; flex-direction: column; gap: 24px; min-width: 0; transition: opacity .15s; }
.tea-resultado.is-stale { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .tea-resultado { transition: none; } }
.tea-bloque { border-top: 2px solid var(--border-strong); padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.tea-bloque h2 { font-size: 28px; line-height: 34px; }
.tea-esc { table-layout: fixed; }
.tea-esc thead th { font-family: var(--font-ui); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); text-align: left; }
.tea-esc .tea-etq th { font-family: var(--font-ui); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); padding: 12px 0 2px; border: 0; text-transform: none; letter-spacing: 0; }
.tea-esc td { font-family: var(--font-mono); font-size: 16px; line-height: 24px; padding: 0 8px 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.tea-esc .tea-grande td { font-size: 26px; line-height: 34px; font-weight: 700; }
.tea-esc .tea-grande td.is-base { color: var(--primary); }
.tea-nota { font-size: 14px; line-height: 22px; color: var(--muted); }
.tea-nota strong { color: var(--text); font-weight: 600; }
.tea-decision { border-top: 2px solid var(--border-strong); border-bottom: 1px solid var(--border); padding: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.tea-decision h3 { font-size: 22px; line-height: 30px; }
.tea-aviso { font-size: 15px; line-height: 24px; padding-top: 12px; border-top: 1px solid var(--border); }
.tea-aviso .tag { margin-right: 6px; }
@media (max-width: 520px) {
  .tea-esc .tea-grande td { font-size: 19px; line-height: 26px; }
  .tea-esc td { font-size: 14px; }
  .tea-intro .wrap { padding-top: 40px; }
}

/* Desglose */
.tea-desglose { max-width: 820px; }
.tea-barra { padding: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.tea-barra-cab { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-family: var(--font-ui); font-size: 15px; line-height: 22px; font-weight: 600; }
.tea-barra-cab .mono { font-weight: 400; }
.tea-pc { color: var(--muted); display: inline-block; min-width: 4.5ch; text-align: right; }
.tea-pista-barra { height: 6px; background: var(--border); border-radius: 2px; overflow: hidden; }
.tea-pista-barra i { display: block; height: 100%; background: var(--text); }
.tea-sub { font-size: 14px; line-height: 22px; color: var(--muted); }
.tea-sub .mono { font-size: 13px; }
.tea-total { border-top: 2px solid var(--border-strong) !important; }
.tea-total .tea-barra-cab .mono { font-weight: 700; }

/* Rentabilidad */
.tea-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 32px; margin: 0; }
.tea-dato { border-top: 1px solid var(--border); padding: 16px 0; min-width: 0; }
.tea-dato dt { font-family: var(--font-ui); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.tea-dato dd { margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }
.tea-valor { font-size: 22px; line-height: 30px; font-weight: 700; overflow-wrap: anywhere; }

/* Tablas y desplegables */
.tea-scroll { overflow-x: auto; }
.tea-tabla { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.tea-tabla th, .tea-tabla td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.tea-tabla thead th { font-family: var(--font-ui); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--border-strong); white-space: nowrap; }
.tea-tabla tbody th { font-weight: 400; }
.tea-tabla .mono { white-space: nowrap; }
.tea-num td { font-family: var(--font-mono); font-size: 14px; text-align: right; white-space: nowrap; }
.tea-num th { text-align: right; }
.tea-suma th, .tea-suma td { font-weight: 700 !important; border-top: 2px solid var(--border-strong); }
.tea-detalles { border-top: 1px solid var(--border); }
.tea-detalles:last-child { border-bottom: 1px solid var(--border); }
.tea-detalles > summary { cursor: pointer; padding: 16px 0; font-family: var(--font-ui); font-size: 16px; line-height: 24px; font-weight: 600; list-style-position: outside; margin-left: 18px; }
.tea-detalles[open] > summary { padding-bottom: 8px; }
.tea-detalles > .tea-scroll, .tea-detalles > p { margin-bottom: 20px; }
.tea-lista li { padding: 14px 0; }

/* Pista de la versión avanzada y descarga */
.tea-pista { border-top: 2px solid var(--border-strong); padding-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.tea-pista strong { font-weight: 700; }
.tea-link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.news .tea-check { display: flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: 0; text-transform: none; cursor: pointer; }
.news .tea-opc { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Barra fija en móvil con el resultado del caso base */
.tea-barra-movil { display: none; }
@media (max-width: 959px) {
  .tea-barra-movil {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg); border-top: 2px solid var(--border-strong); font-family: var(--font-ui); font-size: 14px; line-height: 20px;
  }
  .tea-barra-movil.is-oculta { display: none; }
  .tea-barra-movil .mono { font-size: 18px; font-weight: 700; color: var(--primary); }
  .tea-barra-movil a { font-weight: 600; color: var(--text); text-underline-offset: 3px; white-space: nowrap; }
  body { padding-bottom: 64px; }
}

/* Campo trampa para bots: fuera de la vista, sin display:none (algunos bots lo detectan) */
.tea-trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Casilla de consentimiento y lista de espera */
.tea-check { display: flex; align-items: flex-start; gap: 10px; font-family: var(--font-ui); font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: 0; text-transform: none; cursor: pointer; }
.tea-check input { margin-top: 1px; flex: 0 0 auto; }
.news .tea-check { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; }
.tea-ir-informe { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 4px; }
.tea-espera h2 { font-size: 28px; line-height: 34px; }
.tea-espera > p { max-width: 640px; }
.tea-espera label:not(.tea-check) { font-family: var(--font-ui); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.tea-ok { font-family: var(--font-ui); font-weight: 600; }
.tea-espera .form-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tea-espera .form-row input { flex: 1 1 200px; min-width: 0; }
