/* ===================================================================
   Calculadora de engagement (/herramientas/calculadora-engagement)
   Mismo lenguaje que el visor de Instagram. Móvil primero: el buscador
   entra en la primera pantalla y el resultado se lee de arriba abajo.
   =================================================================== */
.ec-page {
  --ec-pink: #e61c72; --ec-pink-2: #ff4d94; --ec-ink: #14181f; --ec-muted: #6b7280;
  --ec-line: #e8eaed; --ec-soft: #f8f9fb;
  --ec-low: #dc2626; --ec-mid: #d97706; --ec-ok: #16a34a; --ec-top: #0e7490;
  background: #fff; color: var(--ec-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.ec-page *, .ec-page *::before, .ec-page *::after { box-sizing: border-box; }
.ec-page img { max-width: 100%; }
.ib-hero--ec .ib-hero__title { max-width: 18ch; }
.ib-hero--ec.ib-hero--compact { padding-bottom: 44px; }
@media (min-width: 1024px) { .ib-hero--ec.ib-hero--compact { padding: 64px 0 56px; } }

.ec { padding: 28px 0 56px; }
.ec__inner { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* — Formulario — */
.ec-form {
  padding: 18px 16px 16px; border: 1px solid var(--ec-line); border-radius: 18px; background: #fff;
  box-shadow: 0 18px 40px -24px rgba(20, 24, 31, .35);
}
.ec-form__platforms { display: flex; gap: 8px; margin-bottom: 14px; }
.ec-pill { position: relative; cursor: pointer; }
.ec-pill input { position: absolute; opacity: 0; pointer-events: none; }
.ec-pill span {
  display: inline-block; padding: .5rem 1rem; border: 1.5px solid var(--ec-line); border-radius: 999px;
  font-size: .86rem; font-weight: 700; color: #4b5563; background: var(--ec-soft); transition: all .15s;
}
.ec-pill input:checked + span { border-color: var(--ec-pink); color: #a91258; background: #fff0f6; }
.ec-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(230, 28, 114, .2); }
.ec-form__label { display: block; margin-bottom: 8px; font-size: .8rem; font-weight: 700; }
.ec-form__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; position: relative; }
.ec-form__at { position: absolute; left: 14px; top: .85rem; font-weight: 700; color: #9ca3af; pointer-events: none; }
.ec-form__input {
  width: 100%; padding: .85rem .95rem .85rem 2rem; border: 1.5px solid #e2e5ea; border-radius: 12px;
  font: inherit; font-size: 16px; color: var(--ec-ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.ec-form__input:focus { outline: none; border-color: var(--ec-pink); box-shadow: 0 0 0 3px rgba(230, 28, 114, .12); }
.ec-form__btn {
  width: 100%; padding: .85rem 1.15rem; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--ec-pink) 0%, var(--ec-pink-2) 100%); color: #fff;
  font: inherit; font-size: .95rem; font-weight: 700; box-shadow: 0 10px 22px -12px rgba(230, 28, 114, .75);
}
.ec-form__btn:disabled { opacity: .7; cursor: progress; }
.ec-form__btn--sm { width: auto; padding: .65rem 1.4rem; font-size: .88rem; }
.ec-form__help { margin: 10px 0 0; font-size: .78rem; line-height: 1.55; color: var(--ec-muted); }
.ec-form__example {
  padding: 2px 8px; border: 1px solid var(--ec-line); border-radius: 999px; background: var(--ec-soft);
  color: #4b5563; font: inherit; font-size: .76rem; cursor: pointer;
}
.ec-form__example:hover { border-color: var(--ec-pink); color: #a91258; }
@media (min-width: 640px) {
  .ec-form { padding: 22px 22px 18px; }
  .ec-form__row { grid-template-columns: minmax(0, 1fr) auto; }
  .ec-form__btn { width: auto; }
}

/* — Estados — */
.ec-loading { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--ec-soft); color: #4b5563; font-size: .9rem; }
.ec-spin { width: 18px; height: 18px; border: 2.5px solid #f3c2d8; border-top-color: var(--ec-pink); border-radius: 50%; animation: ec-spin .8s linear infinite; flex: none; }
@keyframes ec-spin { to { transform: rotate(360deg); } }
.ec-left { margin: 10px 2px 0; font-size: .8rem; color: var(--ec-muted); text-align: center; }
.ec-alert { margin-top: 18px; padding: 13px 15px; border: 1.5px solid #fde68a; border-radius: 14px; background: #fffbeb; color: #78350f; font-size: .9rem; line-height: 1.5; }

/* — Resultado — */
.ec-res {
  --ec-tier: var(--ec-mid);
  margin-top: 18px; padding: 18px 16px; border: 1px solid var(--ec-line); border-radius: 18px; background: #fff;
  box-shadow: 0 18px 40px -26px rgba(20, 24, 31, .35); scroll-margin-top: 80px;
}
.ec-res--bajo { --ec-tier: var(--ec-low); }
.ec-res--normal { --ec-tier: var(--ec-mid); }
.ec-res--bueno { --ec-tier: var(--ec-ok); }
.ec-res--excelente { --ec-tier: var(--ec-top); }
.ec-res__head { display: flex; align-items: center; gap: 12px; }
.ec-res__avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--ec-soft); }
.ec-res__avatar--empty { display: grid; place-items: center; font-weight: 800; color: var(--ec-pink); }
.ec-res__user { margin: 0; font-size: 1.05rem; font-weight: 800; word-break: break-all; }
.ec-res__meta { margin: 2px 0 0; font-size: .82rem; color: var(--ec-muted); }
.ec-res__score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-top: 16px; }
.ec-res__er { font-size: clamp(2.4rem, 9vw, 3.2rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--ec-tier); }
.ec-res__verdict { padding: 4px 11px; border-radius: 999px; font-size: .8rem; font-weight: 800; color: #fff; background: var(--ec-tier); }
.ec-res__basis { margin: 8px 0 0; font-size: .82rem; color: var(--ec-muted); }

.ec-gauge { position: relative; height: 10px; margin-top: 16px; border-radius: 999px; background: #eef0f3; }
.ec-gauge__band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: #bbf7d0; }
.ec-gauge__mark {
  position: absolute; top: 50%; width: 18px; height: 18px; margin-left: -9px; transform: translateY(-50%);
  border: 3px solid #fff; border-radius: 50%; background: var(--ec-tier); box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.ec-gauge__legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: .74rem; color: var(--ec-muted); }
.ec-gauge__legend span:last-child { text-align: right; }

.ec-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; }
.ec-stats div { padding: 10px 12px; border-radius: 12px; background: var(--ec-soft); }
.ec-stats dt { font-size: .72rem; color: var(--ec-muted); line-height: 1.3; }
.ec-stats dd { margin: 3px 0 0; font-size: 1.02rem; font-weight: 800; }
@media (min-width: 640px) { .ec-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ec-res { padding: 22px; } }

.ec-res__h3 { margin: 22px 0 10px; font-size: .95rem; font-weight: 800; }
.ec-posts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .ec-posts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ec-post a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--ec-soft); color: #fff; text-decoration: none; }
.ec-post img, .ec-post__noimg { display: block; width: 100%; height: 100%; object-fit: cover; }
.ec-post__bar { position: absolute; left: 6px; bottom: 22px; width: 5px; height: calc(100% - 34px); border-radius: 3px; background: rgba(255, 255, 255, .35); display: flex; align-items: flex-end; }
.ec-post__bar span { display: block; width: 100%; border-radius: 3px; background: #fff; }
.ec-post__er { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: .72rem; font-weight: 800; text-align: right; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }

/* — Productos (recomendados y fijos) — */
.ec-recs { margin-top: 6px; padding-top: 4px; }
.ec-shop__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .ec-shop__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ec-prod {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 15px; border: 1.5px solid var(--ec-line); border-radius: 14px;
  background: #fff; color: var(--ec-ink); text-decoration: none; transition: border-color .15s, transform .15s;
}
.ec-prod:hover { border-color: var(--ec-pink); transform: translateY(-1px); text-decoration: none; color: var(--ec-ink); }
.ec-prod--rec:first-child { border-color: var(--ec-pink); background: #fff7fb; }
.ec-prod__name { font-weight: 800; font-size: .95rem; }
.ec-prod__why { font-size: .84rem; line-height: 1.5; color: #4b5563; }
.ec-prod__price { margin-top: 4px; font-size: .86rem; font-weight: 800; color: #a91258; }
.ec-shop__note { margin: 10px 0 0; font-size: .76rem; color: var(--ec-muted); }
.ec-shop { margin: 28px 0; padding: 20px 16px; border-radius: 18px; background: linear-gradient(135deg, #fff0f6 0%, #fff 70%); border: 1px solid #fbd3e4; }
.ec-shop__kicker { margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #a91258; }
.ec-shop__title { margin: 4px 0 14px; font-size: 1.2rem; }

/* — Cálculo manual — */
.ec-manual { margin-top: 18px; border: 1px solid var(--ec-line); border-radius: 16px; background: var(--ec-soft); }
.ec-manual summary { padding: 14px 16px; font-weight: 700; font-size: .92rem; cursor: pointer; list-style: none; }
.ec-manual summary::-webkit-details-marker { display: none; }
.ec-manual summary::after { content: "+"; float: right; font-weight: 800; color: var(--ec-pink); }
.ec-manual[open] summary::after { content: "–"; }
.ec-manual__body { padding: 0 16px 16px; }
.ec-manual__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ec-manual__grid label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 700; }
.ec-manual__grid input, .ec-manual__grid select {
  padding: .65rem .75rem; border: 1.5px solid #e2e5ea; border-radius: 10px; font: inherit; font-size: 16px; background: #fff; color: var(--ec-ink);
}
@media (min-width: 640px) { .ec-manual__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ec-manual__hint { margin: 10px 0 12px; font-size: .78rem; color: var(--ec-muted); }
.ec-manual__res { margin: 12px 0 0; font-size: .95rem; }

/* — Contenido — */
.ec-content { margin-top: 40px; font-size: 1rem; line-height: 1.7; color: #262b33; }
.ec-content h2 { margin: 36px 0 12px; font-size: clamp(1.3rem, 4.5vw, 1.6rem); line-height: 1.25; color: var(--ec-ink); }
.ec-content a { color: #a91258; font-weight: 600; }
.ec-byline { margin: 0; font-size: .8rem; color: var(--ec-muted); }
.ec-formulas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 760px) { .ec-formulas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ec-formula { padding: 16px; border: 1px solid var(--ec-line); border-radius: 14px; background: #fff; font-size: .9rem; }
.ec-formula__tag { display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 999px; background: #fff0f6; color: #a91258; font-size: .72rem; font-weight: 800; }
.ec-formula strong { display: block; }
.ec-formula code { display: block; margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--ec-soft); font-size: .8rem; white-space: normal; color: var(--ec-ink); }
.ec-formula p { margin: 0; color: #4b5563; line-height: 1.55; }
.ec-table-wrap { margin: 16px 0; overflow-x: auto; }
.ec-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ec-table caption { padding-bottom: 8px; text-align: left; font-weight: 800; }
.ec-table th, .ec-table td { padding: 10px 12px; border-bottom: 1px solid var(--ec-line); text-align: left; }
.ec-table th { background: var(--ec-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #4b5563; }
.ec-list { margin: 12px 0; padding: 0; list-style: none; }
.ec-list li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.ec-list__check { position: absolute; left: 0; top: 4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff0f6; color: var(--ec-pink); }
.ec-list__check svg { width: 12px; height: 12px; }
.ec-ol { padding-left: 1.2rem; }
.ec-ol li { margin-bottom: 10px; padding-left: 4px; }
.ec-faq { margin-top: 10px; }
.ec-faq__item { border-bottom: 1px solid var(--ec-line); }
.ec-faq__item summary { padding: 14px 28px 14px 0; font-weight: 700; cursor: pointer; list-style: none; position: relative; }
.ec-faq__item summary::-webkit-details-marker { display: none; }
.ec-faq__item summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.2rem; color: var(--ec-pink); }
.ec-faq__item[open] summary::after { content: "–"; }
.ec-faq__item p { margin: 0 0 14px; color: #4b5563; }

.ec-related { margin-top: 36px; padding: 16px; border-radius: 14px; background: var(--ec-soft); }
.ec-related__label { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ec-muted); }
.ec-related ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ec-related a { display: inline-block; padding: 6px 12px; border: 1px solid var(--ec-line); border-radius: 999px; background: #fff; color: var(--ec-ink); font-size: .85rem; text-decoration: none; }
.ec-related a:hover { border-color: var(--ec-pink); color: #a91258; }
