/* =========================================================
   Business Leaders — Contador de caracteres
   Se apoya en contacto.css (variante .ct-bl): mismas variables,
   encabezado, tarjetas y pasos. Aquí solo lo propio de la herramienta.
   ========================================================= */

.cc-hero .ct-eyebrow a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cc-hero .ct-eyebrow a:hover { color: var(--emso-wine); }

/* ---------- Editor ---------- */
.cc-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.cc-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.cc-editor-head .ct-card-title { margin: 0; }

.cc-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid color-mix(in srgb, var(--emso-navy) 22%, transparent);
  border-radius: 999px;
  background: var(--emso-white);
  color: var(--emso-navy);
  font: 600 14px "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.cc-tool svg { width: 16px; height: 16px; }
.cc-tool:hover { border-color: var(--emso-navy); background: var(--emso-navy); color: var(--emso-white); }
.cc-tool--danger:hover { border-color: #b91c1c; background: #b91c1c; }
.cc-tool:focus-visible { outline: 2px solid var(--emso-wine); outline-offset: 2px; }

textarea.cc-text {
  min-height: 460px;
  font-size: 17px;
  line-height: 1.65;
}

/* Resumen bajo el texto: solo en pantallas donde el panel queda abajo */
.cc-mini { display: none; margin: 10px 0 0; font-size: 15px; font-weight: 600; color: var(--emso-navy); font-variant-numeric: tabular-nums; }

/* ---------- Límite ---------- */
.cc-limit { margin-top: 22px; display: grid; gap: 14px; }
.cc-limit-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.cc-limit-custom { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 8px; }

.cc-bar-track {
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--emso-navy) 12%, transparent);
  overflow: hidden;
}
.cc-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--emso-wine);
  transition: width 0.25s ease, background-color 0.25s ease;
}
.cc-bar-text { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--emso-navy); }
.cc-bar.is-near .cc-bar-fill { background: #d97706; }
.cc-bar.is-over .cc-bar-fill { background: #b91c1c; }
.cc-bar.is-over .cc-bar-text { color: #b91c1c; }

.cc-save-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 22px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--emso-slate);
}
.cc-save-note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.cc-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--emso-navy);
  color: var(--emso-white);
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Panel de resultados ---------- */
.cc-panel { position: sticky; top: 120px; display: grid; gap: 18px; }

.cc-hero-stat {
  display: grid;
  gap: 4px;
  padding: 26px 28px;
  border-radius: var(--radius-card);
  background: var(--emso-navy);
  color: var(--emso-white);
}
.cc-hero-num {
  font-family: var(--font-display);
  font-size: clamp(56px, 6vw, 88px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cc-hero-label { font-size: 16px; font-weight: 600; color: rgba(255, 255, 255, 0.78); }

.cc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.cc-stat {
  padding: 16px 18px;
  border-bottom: 1px solid var(--slate-line);
}
.cc-stat:nth-child(odd) { border-right: 1px solid var(--slate-line); }
.cc-stat:nth-last-child(-n + 2) { border-bottom: 0; }
.cc-stat dt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--emso-slate);
}
.cc-stat dd {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--emso-navy);
  font-variant-numeric: tabular-nums;
}
.cc-hint {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--emso-navy) 12%, transparent);
  color: var(--emso-navy);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.cc-block {
  padding: 20px 22px;
  border-radius: var(--radius-card);
  background: var(--slate-soft);
}
.cc-block-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  text-transform: uppercase;
  color: var(--emso-navy);
}
.cc-block p { margin: 0; font-size: 15px; line-height: 1.5; color: #374151; }
.cc-block--tip { background: color-mix(in srgb, #d97706 10%, var(--emso-white)); }

.cc-top { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cc-top li {
  display: grid;
  grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.cc-top .cc-empty { display: block; color: var(--emso-slate); }
.cc-top-word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--emso-navy); }
.cc-top-bar { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--emso-navy) 10%, transparent); overflow: hidden; }
.cc-top-bar span { display: block; height: 100%; border-radius: inherit; background: var(--emso-wine); }
.cc-top-n { font-size: 13px; color: var(--emso-slate); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cc-cta { justify-self: start; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .cc-main { grid-template-columns: 1fr; }
  .cc-panel { position: static; }
  textarea.cc-text { min-height: 320px; }
  .cc-mini { display: block; }
}
@media (max-width: 600px) {
  .cc-limit-controls { grid-template-columns: 1fr; }
  .cc-tool { padding: 0 12px; }
}
