/* Pulso Ciudadano — panel cívico: azul profundo + turquesa, mobile-first */
:root {
  --navy: #0b2b5e; --navy-2: #123a7a; --turq: #0e9f93; --turq-cl: #e6f7f5;
  --texto: #10233f; --gris: #64748b; --borde: #e3e8f0; --fondo: #f4f7fb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, "Liberation Sans", sans-serif; background: var(--fondo); color: var(--texto); font-size: 15px; min-height: 100dvh; }
.cabecera { position: sticky; top: 0; z-index: 30; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; }
.cabecera .marca { display: flex; align-items: center; gap: 10px; }
.cabecera b { font-size: 16.5px; display: block; letter-spacing: .2px; }
.cabecera span { font-size: 11.5px; opacity: .8; display: block; }
.chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 20px; padding: 4px 11px; font-size: 11px; white-space: nowrap; }
.chip.ok { background: rgba(16,185,129,.25); border-color: rgba(16,185,129,.6); }
.chip.warn { background: rgba(245,158,11,.25); border-color: rgba(245,158,11,.6); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 9px 10px; background: #fff; border-bottom: 1px solid var(--borde); position: sticky; top: 60px; z-index: 25; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--borde); background: #fff; color: var(--gris); border-radius: 20px; padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tab.activa { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
main { max-width: 860px; margin: 0 auto; padding: 14px 12px 60px; }
.vista { display: none; } .vista.activa { display: block; }
.aviso { background: var(--turq-cl); border: 1px solid #bfe8e3; color: #0b5f57; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin-bottom: 12px; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 13px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(15,35,70,.03); }
.tarjeta h3 { font-size: 13.5px; color: var(--navy); margin-bottom: 8px; }
.barra { margin-bottom: 10px; }
.btn-primario { background: var(--navy); color: #fff; border: 0; border-radius: 11px; padding: 11px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primario:hover { background: var(--navy-2); }
.btn-primario:disabled { opacity: .55; }
.btn-sec { background: #fff; border: 1px solid #cdd8ea; color: var(--navy); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mini { border: 1px solid var(--borde); background: #fff; border-radius: 9px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.mini.danger { color: #b42318; border-color: #f0c9c5; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--texto); border: 1px solid var(--borde); border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
#buscarConvo, #simTexto { margin-bottom: 8px; }
.fila { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.fila input, .fila select { flex: 1; min-width: 110px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; margin-bottom: 10px; }
.stat { background: #fff; border: 1px solid var(--borde); border-radius: 13px; padding: 11px 12px; }
.stat b { display: block; font-size: 22px; color: var(--navy); }
.stat span { font-size: 11.5px; color: var(--gris); }
.lista { display: flex; flex-direction: column; gap: 9px; }
.mini-lista { font-size: 12.5px; color: var(--gris); line-height: 1.8; }
.pill { display: inline-block; border-radius: 12px; padding: 2px 9px; font-size: 10.5px; font-weight: 600; }
.p-nuevo { background: #f1f5f9; color: #475569; } .p-preguntando { background: #e8effd; color: #1d4ed8; }
.p-obras { background: #f3e8ff; color: #7e22ce; } .p-cerrado { background: #e7f7ee; color: #067647; }
.pregunta textarea.p-texto { margin: 6px 0; }
.op { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.op input.o-texto { flex: 2; } .op input.o-categoria { flex: 1; font-size: 12.5px; }
.thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 9px; border: 1px solid var(--borde); }
.subir { font-size: 12px; color: var(--navy); border: 1px dashed #b9c8e3; border-radius: 9px; padding: 7px 10px; cursor: pointer; background: #f7faff; }
.fotos { display: flex; gap: 7px; flex-wrap: wrap; margin: 8px 0; }
.foto { position: relative; }
.foto button { position: absolute; top: -6px; right: -6px; background: #b42318; color: #fff; border: 0; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; cursor: pointer; }
.check { font-size: 12.5px; color: var(--gris); display: flex; align-items: center; gap: 6px; width: auto; }
.check input { width: auto; }
.chat { background: #e9eef5; border-radius: 14px; padding: 12px; min-height: 300px; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; margin-bottom: 9px; }
.burbuja { max-width: 82%; padding: 8px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.burbuja.in { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.burbuja.out { align-self: flex-end; background: #d8f3ee; border-bottom-right-radius: 4px; }
.burbuja img { max-width: 100%; border-radius: 8px; display: block; margin-bottom: 4px; }
.burbuja.poll { background: #fff; border: 1px solid #cfe0f5; }
.poll-t { font-weight: 600; margin-bottom: 5px; }
.poll-o { font-size: 12.5px; color: #1d4ed8; padding: 2px 0; }
.qr-caja { text-align: center; min-height: 120px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }
.qr-caja img { width: 250px; height: 250px; image-rendering: pixelated; border-radius: 10px; border: 1px solid var(--borde); }
.convo-item { cursor: pointer; }
.convo-item:hover { border-color: #b9c8e3; }
.s { font-size: 12px; color: var(--gris); }
.barras { margin-top: 6px; }
.barra-item { margin: 7px 0; }
.barra-item .t { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 3px; }
.barra-item .barra { height: 7px; background: #eef2f8; border-radius: 4px; overflow: hidden; }
.barra-item .relleno { height: 100%; background: var(--turq); border-radius: 4px; }
.transcripcion { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; background: #f7f9fc; padding: 10px; border-radius: 11px; }
.resp { font-size: 12.5px; border-top: 1px dashed var(--borde); padding: 6px 0; color: var(--gris); }

/* ── dashboard ── */
.dash-head { display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 10px; }
.dash-title { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: .2px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 10px; }
.kpi { background: #fff; border: 1px solid var(--borde); border-radius: 15px; padding: 13px 14px; box-shadow: 0 1px 2px rgba(15,35,70,.03); }
.kpi span { font-size: 11px; color: var(--gris); text-transform: uppercase; letter-spacing: .6px; }
.kpi b { display: block; font-size: 28px; line-height: 1.15; color: var(--navy); margin: 3px 0 1px; }
.kpi i { font-style: normal; font-size: 11px; color: var(--gris); }
.kpi-navy { background: linear-gradient(135deg, #0b2b5e, #164a8f); border: 0; }
.kpi-navy span, .kpi-navy i { color: #b9cdec; }
.kpi-navy b { color: #fff; }
.kpi-teal { background: linear-gradient(135deg, #0e9f93, #0b7f76); border: 0; }
.kpi-teal span, .kpi-teal i { color: #c9f1ec; }
.kpi-teal b { color: #fff; }
.chart-dias { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 8px; }
.dia { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; }
.barras-d { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; }
.bar-d { width: 45%; min-height: 2px; border-radius: 4px 4px 0 0; transition: height .5s ease; }
.bar-d.navy { background: linear-gradient(180deg, #164a8f, #0b2b5e); }
.bar-d.teal { background: linear-gradient(180deg, #35c6ba, #0e9f93); }
.dia span { font-size: 9px; color: var(--gris); height: 12px; }
.chart-horas { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 8px; }
.hora { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-h { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #35c6ba, #0e7f77); transition: height .5s ease; }
.hora span { font-size: 8.5px; color: var(--gris); height: 11px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 9px; }
@media (min-width: 620px) { .grid2 { grid-template-columns: 1fr 1fr; } .kpis { grid-template-columns: repeat(4, 1fr); } }
.fila-embudo { display: grid; grid-template-columns: 96px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; margin: 9px 0; }
.fila-embudo span { color: var(--gris); }
.fila-embudo b { text-align: right; color: var(--navy); }
.fbar { height: 12px; background: #eef2f8; border-radius: 7px; overflow: hidden; }
.fbar div { height: 100%; background: linear-gradient(90deg, #0b2b5e, #0e9f93); border-radius: 7px; transition: width .5s ease; }
.duracion-big { font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip-stat { background: #f2f6fc; border: 1px solid var(--borde); border-radius: 10px; padding: 7px 10px; font-size: 10.5px; color: var(--gris); text-align: center; }
.chip-stat b { display: block; font-size: 14px; color: var(--navy); }
.pregunta-dash { padding: 10px 0; border-bottom: 1px dashed var(--borde); }
.pregunta-dash:last-child { border-bottom: 0; }
.pregunta-dash h4 { font-size: 12.5px; color: var(--navy); margin-bottom: 6px; line-height: 1.35; }
.quote { background: #f7fafc; border-left: 3px solid var(--turq); border-radius: 6px; padding: 8px 10px; margin: 7px 0; font-size: 12.5px; color: var(--texto); line-height: 1.45; }
.quote .s { margin-top: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 6px; }
.dot.navy { background: #0b2b5e; }
.dot.teal { background: #0e9f93; }

/* barras verticales pequeñas */
.mini-barras { display: flex; align-items: flex-end; gap: 7px; height: 118px; padding: 4px 2px 0; overflow-x: auto; }
.mb { flex: 1 0 46px; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 42px; }
.mb-n { font-size: 9.5px; font-weight: 700; color: var(--navy); height: 12px; }
.mb-col { flex: 1; width: 16px; background: #eef2f8; border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.mb-bar { width: 100%; min-height: 2px; background: linear-gradient(180deg, #35c6ba, #0e7f77); border-radius: 4px 4px 0 0; transition: height .5s ease; }
.mb-bar.navy { background: linear-gradient(180deg, #164a8f, #0b2b5e); }
.mb-l { font-size: 8.5px; color: var(--gris); text-align: center; line-height: 1.15; height: 20px; overflow: hidden; margin-top: 2px; }
.demo-bloque { margin-bottom: 12px; }
.lista-insights { margin: 4px 0 0 16px; padding: 0; font-size: 12.5px; line-height: 1.5; color: var(--texto); }
.lista-insights li { margin: 5px 0; }
.ia-box { margin-top: 10px; border-left: 3px solid var(--turq); background: #f4fbfa; border-radius: 6px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.ia-box p { margin: 4px 0; }
.ia-t { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.reportes { gap: 8px; flex-wrap: wrap; }
.tarjeta-gris { background: #f4f7fb; border: 1px solid var(--borde); border-radius: 9px; padding: 9px 11px; font-size: 12.5px; margin-bottom: 10px; }
.contraste-grupos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.tabla-dash { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tabla-dash th { background: #eef4fb; color: var(--navy); text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--borde); }
.tabla-dash td { padding: 5px 6px; border-bottom: 1px solid #f0f3f8; }
.tabla-dash .num { text-align: right; }

/* estrategia */
.timer-card { background: linear-gradient(135deg, #0b2b5e, #164a8f); color: #fff; border: 0; }
.timer-card h3 { color: #c9dcf5; }
.timer-card input { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.timer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.tbox { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 11px; padding: 9px 6px; text-align: center; }
.tbox b { display: block; font-size: 24px; line-height: 1.1; }
.tbox span { font-size: 10px; color: #b9cdec; text-transform: uppercase; letter-spacing: .5px; }
.timer-card .barra { background: rgba(255,255,255,.16); }
.timer-card .relleno { background: linear-gradient(90deg, #35c6ba, #7bf0e4); }
.prob-card { background: linear-gradient(135deg, #0e9f93, #0b7f76); color: #fff; border: 0; }
.prob-card h3 { color: #d6f6f2; }
.prob-wrap { display: flex; align-items: baseline; gap: 10px; }
.prob-big { font-size: 52px; font-weight: 800; line-height: 1; }
.prob-card .s { color: #d6f6f2; }
.prob-card .chip-stat { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #eafffd; }
.prob-card .chip-stat b { color: #fff; font-size: 16px; }
.reco { border-bottom: 1px dashed var(--borde); padding: 7px 0; font-size: 12.5px; line-height: 1.45; }
.reco:last-child { border-bottom: 0; }
.reco .pill { margin-right: 4px; }
.op-card .op-texto { font-size: 13px; line-height: 1.5; margin: 5px 0; }
.op-card audio { height: 34px; }

/* radar rojo */
.radar-hero { background: linear-gradient(135deg, #7f1d1d, #dc2626); color: #fff; border-radius: 14px; padding: 15px; margin-bottom: 10px; box-shadow: 0 6px 20px rgba(185,28,28,.28); }
.radar-eyebrow { font-size: 10px; letter-spacing: 2px; color: #fecaca; font-weight: 700; }
.radar-title { font-size: 23px; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.radar-hero input { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.radar-hero input::placeholder { color: #fecaca; }
.radar-hero .btn-sec { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.45); }
.radar-pulse { border: 1px solid #fecaca; background: linear-gradient(180deg, #fff, #fff5f5); }
.pulse-row { display: flex; align-items: center; gap: 12px; }
.pulse-heart { font-size: 40px; color: #dc2626; animation: latido 1.6s infinite; }
@keyframes latido { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.2); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
.pulse-val { font-size: 46px; font-weight: 800; color: #b91c1c; line-height: 1; }
.pulse-stats { display: flex; gap: 12px; text-align: right; flex-wrap: wrap; }
.pulse-stats b { display: block; font-size: 17px; color: #b91c1c; }
.pulse-stats span { font-size: 9px; color: var(--gris); text-transform: uppercase; letter-spacing: .4px; }
.radar-bar { height: 10px; background: #fee2e2; border-radius: 6px; margin-top: 10px; overflow: hidden; }
#pulseBar { height: 100%; background: linear-gradient(90deg, #f87171, #b91c1c); transition: width .6s; }
.btn-radar { background: linear-gradient(135deg, #b91c1c, #7f1d1d); color: #fff; border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-radar:hover { filter: brightness(1.08); }
.btn-radar:disabled { opacity: .55; }
.mention { border-left: 3px solid #dc2626; }
.mention-t { display: block; font-weight: 700; color: #7f1d1d; text-decoration: none; font-size: 13.5px; margin-top: 4px; line-height: 1.35; }
.mention-x { font-size: 12.5px; color: #334155; margin-top: 4px; line-height: 1.45; }
.fuente-badge { font-size: 11px; font-weight: 600; color: #b91c1c; background: #fee2e2; border-radius: 10px; padding: 2px 8px; }
.mb-bar.red { background: linear-gradient(180deg, #f87171, #b91c1c); }
.tab[data-v="vRadar"].activa { background: #b91c1c; border-color: #b91c1c; }
.radar-timeline { min-height: 40px; }
