/* Zavora Free Tools — estilos propios de /tools/sales/roi-calculator. Se cargan solo en su página (tools.scripts),
   después de tools.css; lo compartido entre herramientas vive en tools.css. */
/* ---------- Calculadora de ROI de ventas (/tools/sales/roi-calculator) ----------
   Formulario + «¿Cuánto tendrías que vender…?» a la izquierda; resultado a la derecha (ocupa las dos filas).
   En el celular: formulario → resultado → meta. El veredicto lleva icono y título propios (nunca solo color);
   el medidor compara tus ventas con las de equilibrio (marca negra) y su texto dice lo mismo en palabras.
   Prefijo de clases «rc-» (los ids son «roi-»): site.css ya usa «.roi-*» para la calculadora de la home. */
.rc.tl-tool { grid-template-areas: "form result" "goal result"; grid-template-rows: auto 1fr; }
.rc > .tl-tool__form { grid-area: form; }
.rc > .tl-tool__result { grid-area: result; }
.rc > .rc-goal { grid-area: goal; }

/* «Probar con un ejemplo»: objetivo táctil cómodo sin agrandar el título de la sección */
.rc .tl-section__t .tl-link { display: inline-flex; align-items: center; min-height: 32px; white-space: nowrap; }
.rc-fs { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.rc-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.rc-seg label { justify-content: center; min-height: 44px; padding: 0 10px; text-align: center; line-height: 1.2; }
.rc-row { margin-top: 14px; }
.rc-row + .tl-hint { margin-top: 6px; }
.rc-help { margin-top: 10px; font-size: .875rem; color: var(--ink-2); }

/* Inversión por partes: concepto · monto · quitar */
.rc-lines__list { display: grid; gap: 10px; }
.rc-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 10.5rem) 44px; gap: 8px; align-items: end; }
.rc-line .tl-label { font-size: .75rem; font-weight: 500; color: var(--ink-3); margin-bottom: 4px; }
.rc-line .rc-line__sr { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rc-line__del { width: 44px; }
.rc-add { min-height: 44px; margin-top: 6px; }
.rc-lines .tl-hint { margin-top: 2px; }
.rc-lines__sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--bg-alt); font-size: .9rem; color: var(--ink-2); }
.rc-lines__sum strong { font-size: 1.05rem; font-weight: 650; color: var(--ink); white-space: nowrap; }

/* Veredicto */
.rc-verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 12px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--r-lg); }
.rc-verdict__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-alt); color: var(--ink-3); }
.rc-verdict__icon .icon { width: 22px; height: 22px; }
.rc-verdict__t { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
.rc-verdict__d { margin-top: 4px; font-size: .9375rem; color: var(--ink-2); }
.rc-verdict__d + .rc-verdict__d { margin-top: 6px; font-weight: 600; color: var(--ink); }
.rc-verdict[data-kind="profit"] { border-left-color: var(--ok); }
.rc-verdict[data-kind="profit"] .rc-verdict__icon { background: var(--ok-bg); color: var(--ok); }
.rc-verdict[data-kind="even"] { border-left-color: var(--warn); }
.rc-verdict[data-kind="even"] .rc-verdict__icon { background: var(--warn-bg); color: var(--warn); }
.rc-verdict[data-kind="loss"] { border-left-color: var(--bad); }
.rc-verdict[data-kind="loss"] .rc-verdict__icon { background: #fdecec; color: var(--bad); }
/* Un monto muy largo en una frase se parte antes que salirse de su tarjeta */
.rc-verdict__d, .rc-be__d, .rc-per__d, .rc-goal-msg, .rc-warn { overflow-wrap: break-word; }
.rc-warn { margin: 0 0 12px; }
.rc-warn p + p { margin-top: 6px; }

/* Cifras. Cada cifra va en una sola línea: el JS pone su largo en --len y la letra se achica lo justo para
   caber en el ancho de su tarjeta (cqi), sin pasar del tamaño de siempre. Así «$180.000.000» nunca se parte
   en «$180.000.00» + «0», ni el «−» queda solo encima del monto. Los navegadores sin unidades de contenedor
   se quedan con el tamaño de siempre y el corte de tools.css. */
.rc .tl-stat { container-type: inline-size; }
.rc .tl-stat__l { display: block; line-height: 1.3; }
.rc .tl-stat:not(.tl-stat--hero) .tl-stat__v { font-size: 1.25rem; }
@supports (width: 1cqi) {
  .rc .tl-stat__v { white-space: nowrap; overflow-wrap: normal; }
  .rc .tl-stat:not(.tl-stat--hero) .tl-stat__v { font-size: clamp(.75rem, calc(100cqi / (var(--len, 8) * .64)), 1.45rem); }
  .rc .tl-stat--hero .tl-stat__v { font-size: max(1.25rem, min(clamp(2.4rem, 1.8rem + 2.4vw, 3.1rem), calc(100cqi / (var(--len, 6) * .64)))); }
  .rc .tl-stat__v.rc-wrap { white-space: normal; overflow-wrap: anywhere; }
}
.rc .tl-stat--accent .tl-stat__l { color: var(--ink-2); } /* contraste AA sobre el violeta claro */
.rc .tl-stat.is-loss { border-color: var(--bad); }
.rc .tl-stat--hero.is-loss { background: #fff; }
.rc-delta { margin-top: 6px; }

/* Punto de equilibrio */
.rc-be { margin: 12px 0 0; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.rc-be__t { font-weight: 600; font-size: .9375rem; color: var(--ink); }
.rc-be__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-top: 4px; font-size: .875rem; color: var(--ink-2); }
.rc-be__row strong { font-size: 1.2rem; font-weight: 650; color: var(--ink); white-space: nowrap; }
.rc-meter { position: relative; margin-top: 10px; padding: 4px 0; }
.rc-meter .tl-meter { margin-top: 0; height: 12px; }
.rc-meter__mark { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px #fff; }
.rc-be__legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .8125rem; color: var(--ink-2); }
.rc-be__legend li { display: inline-flex; align-items: center; gap: 6px; }
.rc-key { display: inline-block; flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.rc-be.is-short .rc-key:not(.rc-key--mark) { background: var(--warn); }
.rc-key--mark { width: 3px; height: 14px; border-radius: 2px; background: var(--ink); }
.rc-be__d { margin-top: 8px; font-size: .875rem; color: var(--ink-2); }

/* Por pedido o por cliente */
.rc-sub { margin: 16px 0 8px; font: 600 .78rem/1.2 var(--f-body); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.rc-per__list { padding: 4px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.rc-per__list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rc-per__list > div:last-child { border-bottom: 0; }
.rc-per__list dt { flex: 1 1 auto; min-width: 0; font-size: .9rem; color: var(--ink-2); }
.rc-per__list dt small { display: block; font-size: .78rem; color: var(--ink-3); }
.rc-per__list dd { flex: none; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.rc-per__d { margin-top: 8px; font-size: .875rem; color: var(--ink-2); }
.rc-per-hint { margin-top: 12px; }

/* Cómo se calcula */
.rc-explain { margin-top: 16px; }
.rc-explain .tl-formula, .rc-goal-msg .tl-formula { white-space: normal; overflow-wrap: anywhere; overflow-x: visible; }
.rc-nw { white-space: nowrap; }
.rc-formulas { margin: 6px 0 8px; }

/* ¿Cuánto tendrías que vender? */
.rc-goal { padding: 24px 28px 28px; border-top: 1px solid var(--line); min-width: 0; }
.rc-goal__t { font-family: var(--f-display); font-size: 1.2rem; letter-spacing: -.01em; }
.rc-goal__d { margin: 4px 0 14px; font-size: .9375rem; color: var(--ink-2); }
.rc-target { max-width: 10rem; }
.rc-goal-stats { margin-top: 12px; }
.rc-goal-msg { margin-top: 10px; font-size: .9rem; color: var(--ink-2); }
.rc-goal-msg p + .tl-formula { margin-top: 8px; }
.rc-goal-table { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.rc-goal-table:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rc-goal-table caption { padding: 10px 10px 4px; text-align: left; font-weight: 600; font-size: .875rem; color: var(--ink); }
.rc-goal-table tr:last-child td { border-bottom: 0; }
.rc-goal-table tr.is-em td { background: var(--brand-tint); color: var(--ink); font-weight: 600; }
.rc-goal-table .tl-table th { white-space: normal; vertical-align: bottom; }
.rc-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--brand-line); background: #fff; font-size: .7rem; font-weight: 600; color: var(--brand-ink); white-space: nowrap; }

/* PDF (la hoja de impresión vive fuera de [data-tool-root]) */
.rc-doc [hidden] { display: none; }
.rc-doc .rc-verdict, .rc-doc .tl-stats, .rc-doc .rc-be, .rc-doc .rc-explain, .rc-doc .rc-per, .rc-doc .rc-doc__goal { margin-top: 14px; }

@media (max-width: 860px) {
  .rc.tl-tool { grid-template-areas: "form" "result" "goal"; grid-template-rows: auto; }
}
@media (max-width: 640px) {
  .rc-goal { padding: 20px 16px 24px; }
  .rc-seg label { padding: 0 6px; font-size: .8125rem; }
  .rc-line { grid-template-columns: minmax(0, 1fr) 44px; grid-template-areas: "n x" "v v"; row-gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
  .rc-line__n { grid-area: n; }
  .rc-line__v { grid-area: v; }
  .rc-line__del { grid-area: x; }
  .rc-line .rc-line__sr { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .rc-verdict { padding: 14px; gap: 12px; }
  .rc-verdict__t { font-size: 1.15rem; }
  .rc-goal-table .tl-table th, .rc-goal-table .tl-table td { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 359px) {
  .rc-stats, .rc-goal-stats { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .tl-print-sheet .rc-verdict, .tl-print-sheet .rc-be, .tl-print-sheet .rc-explain, .tl-print-sheet .rc-per, .tl-print-sheet .rc-doc__goal { break-inside: avoid; }
  .tl-print-sheet .rc-sub { break-after: avoid; line-height: 1.6; }
  /* Las tildes de las mayúsculas («¿CUÁNTO TENDRÍAS…») sobresalen de la línea: con padding (el margin se recorta en el
     salto de página) quedan dentro del bloque y no se imprimen al pie de la página anterior. */
  .tl-print-sheet .rc-doc__goal { padding-top: 6px; }
}
