/* Módulo Clima y Tableros. Solo tokens de app.css; sin colores fijos ni rayas laterales. */

/* Nota informativa: tinte suave + borde completo */
/* Nota informativa: .notice (app.css) + .cl-note solo para el espaciado interno */
.cl-note { display: grid; gap: 6px; padding: 16px 18px; font-size: 14px; }
.cl-note h2 { margin: 0; }

.cl-actions { text-align: right; white-space: nowrap; }
.cl-actions .btn { margin: 2px 0; }

/* Barras horizontales */
.cl-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cl-bars li { display: grid; grid-template-columns: minmax(96px, 38%) 1fr auto; align-items: center; gap: 12px; }
.cl-bar-label { display: grid; min-width: 0; }
/* Barra: .bar (app.css) */
.cl-bar-value { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cl-bars li.cl-hidden { grid-template-columns: minmax(96px, 38%) 1fr; }
.cl-bars li.cl-hidden .cl-bar-label { color: var(--text-2); }

/* Barra apilada 100 % */
.cl-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); gap: 2px; margin-top: 8px; }
.cl-seg { display: block; height: 100%; }
.cl-seg.fav, .cl-dot.fav, .cl-colbar.fav { background: var(--accent); }
.cl-seg.neu, .cl-dot.neu, .cl-colbar.neu { background: var(--border-strong); }
.cl-seg.unf, .cl-dot.unf, .cl-colbar.unf { background: var(--text-3); }
.cl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.cl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cl-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.cl-qres { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.cl-qres:last-child { border-bottom: 0; padding-bottom: 0; }
.cl-avg { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Columnas en el tiempo */
.cl-cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; align-items: end; }
.cl-col { display: grid; gap: 6px; min-width: 0; text-align: center; }
.cl-col-bars { height: 140px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.cl-colbar { position: relative; width: min(26px, 45%); border-radius: 4px 5px 0 0; }
.cl-colbar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 500; color: var(--text-2); padding-bottom: 2px; white-space: nowrap; }
.cl-col-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Comentarios */
.cl-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cl-comments li { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; justify-items: start; background: var(--surface); }

/* Formulario de respuesta */
.cl-q { margin: 0; min-width: 0; }
.cl-q legend { padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.cl-q legend + * { clear: both; }
.cl-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cl-scale.wide { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.cl-opt { position: relative; }
.cl-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cl-opt span { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 8px; font-weight: 500; cursor: pointer; background: var(--bg); font-variant-numeric: tabular-nums; }
.cl-opt:hover span { background: var(--surface-2); }
.cl-opt input:checked + span { background: var(--sel); border-color: var(--sel); color: var(--on-sel); }
.cl-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.cl-ends { margin-top: 8px; gap: 12px; }
.cl-ends span:last-child { text-align: right; }
textarea.input { resize: vertical; min-height: 96px; }

/* Crear encuesta */
.cl-bank { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cl-check { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; min-height: 38px; }
.cl-check:hover { background: var(--surface); }
.cl-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--sel); flex: none; }
.cl-check:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
select.input:focus, textarea.input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (max-width: 820px) {
  .cl-bars li { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .cl-bars li .cl-bar-label { grid-column: 1 / -1; }
  .cl-bars li.cl-hidden { grid-template-columns: 1fr; }
  .cl-actions { text-align: left; white-space: normal; }
  .cl-scale.wide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cl-col-bars { height: 110px; }
  .cl-colbar b { font-size: 12px; }
  .cl-cols { gap: 2px; }
}

/* Auditoría 07: el formulario del pulso no se estira a 1,100 px (botones de 210 px de ancho); ancho de lectura cómodo. */
#cl-answer { max-width: 860px; }
/* Auditoría 07: etiquetas de barras en 2 líneas como máximo en lugar de cortarse ("Profesional / Anal…", "Diseño · CIARA C…"). */
.cl-bar-label .trunc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }

/* Pulso una pregunta a la vez (fase visual 2B): caritas + palabras, avance, agradecimiento y racha. */
.cl-pulse { max-width: 680px; margin: 0 auto; width: 100%; display: grid; gap: 14px; }
#cl-answer.cl-pulse { max-width: 680px; }
.cl-prog { display: flex; gap: 4px; }
.cl-prog i { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-2); transition: background var(--d2); }
.cl-prog i.on { background: var(--accent); }
.cl-qtext { font-size: 20px; line-height: 1.3; letter-spacing: -.02em; font-weight: 600; margin: 4px 0 2px; text-wrap: balance; color: var(--text); }
label.cl-qtext { font-size: 18px; }
.cl-faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cl-faces button { border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-2); border-radius: 16px; padding: 12px 4px 10px; display: grid; justify-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 550; min-height: 92px; line-height: 1.2; cursor: pointer; transition: transform var(--d1) var(--ease), background var(--d1), border-color var(--d1); }
.cl-faces button:hover { background: var(--surface-2); color: var(--text); }
.cl-faces button:active { transform: scale(.96); }
.cl-faces button.on { background: var(--sel-soft); border-color: var(--sel); color: var(--sel-ink); box-shadow: inset 0 0 0 1px var(--sel); }
.cl-faces button.on svg { color: var(--accent); }
.cl-faces svg { width: 36px; height: 36px; }
.cl-faces button:focus-visible, .cl-nps button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cl-nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.cl-nps button { min-height: 46px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; }
.cl-nps button:hover { background: var(--surface-2); }
.cl-nps button.on { background: var(--sel); border-color: var(--sel); color: var(--on-sel); }
.cl-miss:empty { display: none; }
.cl-miss { color: var(--bad); font-weight: 500; }
.cl-nav { gap: 10px; }
.cl-thanks { text-align: center; justify-items: center; padding: 28px 22px; }
.cl-thanks .il { max-width: 200px; }
.cl-thanks p { max-width: 460px; }
.cl-thanks .notice { text-align: left; max-width: 480px; }
.cl-streak { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.cl-streak i { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-style: normal; font-size: 12px; font-weight: 600; }
.cl-streak i.on { background: var(--accent); color: var(--on-accent); }
.cl-streak i.on:last-child { animation: cl-pop 520ms var(--ease) both; }
@keyframes cl-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.cl-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.cl-confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 12px; border-radius: 4px; background: var(--accent); opacity: .9; transform: rotate(var(--r));
  animation: cl-fall 1.3s var(--d) cubic-bezier(.2,.6,.4,1) forwards; }
.cl-confetti i[style*="--s:1"] { background: var(--warn); border-radius: 50%; width: 8px; height: 8px; }
.cl-confetti i[style*="--s:2"] { background: var(--ok); }
@keyframes cl-fall { to { transform: translateY(70vh) rotate(calc(var(--r) + 300deg)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cl-confetti { display: none; } .cl-streak i.on:last-child { animation: none; } .cl-faces button { transition: none; } }
@media (max-width: 520px) {
  .cl-faces { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .cl-faces button { grid-auto-flow: column; justify-content: start; align-items: center; min-height: 52px; padding: 8px 14px; font-size: 14px; gap: 12px; }
  .cl-faces svg { width: 28px; height: 28px; }
  .cl-nps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cl-qtext { font-size: 18px; }
}

/* Capa de vida · Cómo estoy (2026-09-27): encuesta pendiente como portada en verde, racha en burbujas y candado en la nota de anonimato. */
.cl-top { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); align-items: stretch; }
.cl-top > :only-child { grid-column: 1 / -1; }
.cl-streak { display: grid; gap: 10px; align-content: center; }
.cl-streak .bb-l:empty { display: none; }
.cl-private { display: flex; gap: 14px; align-items: flex-start; background: var(--co-seg-soft); border-color: transparent; color: var(--co-seg-ink); }
.cl-private h2 { color: var(--co-seg-ink); }
.cl-private p { color: var(--co-seg-ink); opacity: .9; }
.cl-lock { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--co-seg-ink); }
@media (max-width: 820px) { .cl-top { grid-template-columns: minmax(0, 1fr); } }
