/* ==========================================================================
   TerreNet — herramientas y páginas de crecimiento (2026-11-09)
   Usa los tokens de tn-2026.css. Cargar después de tn-2026.css y tn-pages.css.
   ========================================================================== */

/* ---------- Calculadora ---------- */
.tt-calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: start; }
.tt-form {
  background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: var(--tn-r3); padding: 24px;
}
.tt-form fieldset { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.tt-form legend {
  float: left; width: 100%; font-weight: 650; font-stretch: 92%; font-size: 1.15rem; color: var(--tn-ink); padding: 0; margin: 0 0 12px;
}
.tt-form legend + * { clear: both; }
.tt-form fieldset + fieldset { border-top: 1px solid var(--tn-line); padding-top: 20px; margin-top: 20px; }
.tt-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; min-width: 0; }
.tt-field:last-child { margin-bottom: 0; }
body .tt-field label { font-size: .95rem; font-weight: 600; color: var(--tn-ink-2); margin: 0; text-transform: none; letter-spacing: 0; }
.tt-field .tn-help { margin: 0; }
.tt-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 8.5rem); gap: 10px; }
.tt-input { position: relative; display: flex; align-items: stretch; }
.tt-input__unit {
  display: inline-flex; align-items: center; padding: 0 12px; font-family: var(--tn-mono); font-size: .9rem; color: var(--tn-ink-2);
  background: var(--tn-sunken); border: 1px solid var(--tn-line-strong); border-right: 0; border-radius: var(--tn-r2) 0 0 var(--tn-r2);
  white-space: nowrap; flex: none;
}
.tt-input__unit--after { border-right: 1px solid var(--tn-line-strong); border-left: 0; border-radius: 0 var(--tn-r2) var(--tn-r2) 0; }
body .tt-form input[type="text"], body .tt-form select {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 1rem; color: var(--tn-ink);
  font-family: var(--tn-mono); font-variant-numeric: tabular-nums;
  background: var(--tn-surface); border: 1px solid var(--tn-line-strong); border-radius: var(--tn-r2); box-shadow: none; margin: 0;
}
body .tt-form select { font-family: var(--tn-font); }
body .tt-input .tt-input__unit + input[type="text"] { border-top-left-radius: 0; border-bottom-left-radius: 0; }
body .tt-input input[type="text"]:has(+ .tt-input__unit--after) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body .tt-form input[type="text"]:focus, body .tt-form select:focus {
  border-color: var(--tn-brand); box-shadow: 0 0 0 3px rgba(24, 121, 78, .18); outline: none;
}
.tt-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-top: 4px; cursor: pointer; font-size: .98rem; color: var(--tn-ink-2); }
.tt-check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--tn-brand); }
.tt-hidden { display: none !important; }

/* Resultado: hoja de cálculo tipo rótulo de plano */
.tt-result {
  position: sticky; top: 16px;
  background: var(--tn-surface); border: 1px solid var(--tn-line-strong); border-radius: var(--tn-r3); padding: 24px;
}
.tt-result h2 { font-size: 1.25rem !important; margin: 0 0 4px !important; }
.tt-result__sub { margin: 0 0 14px; color: var(--tn-muted); font-size: .92rem; }
.tt-result .tn-spec dd { white-space: nowrap; }
.tt-result .tn-spec dt small { display: block; color: var(--tn-muted); font-size: .82rem; margin-top: 2px; font-family: var(--tn-font); }
.tt-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px;
  border-top: 2px solid var(--tn-ink);
}
.tt-total span { font-weight: 650; color: var(--tn-ink); }
.tt-total strong { font-family: var(--tn-mono); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 500; color: var(--tn-ink); }
.tt-total-sub { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 0; color: var(--tn-ink-2); font-size: .95rem; }
.tt-total-sub b { font-family: var(--tn-mono); font-weight: 500; }
.tt-missing {
  margin: 14px 0 0; padding: 10px 12px; border-radius: var(--tn-r2); background: var(--tn-warn-tint); color: var(--tn-warn); font-size: .92rem; line-height: 1.45;
}
.tt-result__note { margin: 14px 0 0; font-size: .88rem; color: var(--tn-muted); line-height: 1.5; }
.tt-result__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Fuentes */
.tt-sources { margin: 0; padding-left: 1.2em; color: var(--tn-ink-2); line-height: 1.6; }
.tt-sources li { margin: 0 0 8px; }

/* ---------- Para inmobiliarias ---------- */
.tt-not { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tt-not li { border-top: 1px dotted var(--tn-line-strong); padding: 14px 0; color: var(--tn-ink-2); line-height: 1.55; }
.tt-not li strong { color: var(--tn-ink); }
.tt-callout {
  margin-top: 24px; padding: 18px 20px; border: 1px dashed var(--tn-line-strong); border-radius: var(--tn-r3); background: #fbfcfb;
}
.tt-callout p { margin: 0 0 12px; color: var(--tn-ink-2); }
.tt-callout p:last-child { margin-bottom: 0; }

@media (max-width: 960px) {
  .tt-calc { grid-template-columns: minmax(0, 1fr); }
  .tt-result { position: static; }
}
@media (max-width: 600px) {
  .tt-form, .tt-result { padding: 18px 16px; }
  .tt-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .tt-form *, .tt-result * { transition: none !important; }
}
@media print {
  .site-header, .site-footer, .tt-form, .tp-hero__ctas, .tt-result__actions, .tn-tabbar { display: none !important; }
  .tt-calc { grid-template-columns: 1fr; }
  .tt-result { border: 0; padding: 0; }
}
