:root {
  --mu-primary: #23917e;
  --mu-primary-dark: #1b7363;
  --mu-primary-soft: #e3f3ef;
  --mu-coral: #ef5b4c;
  --mu-ink: #2f3a45;
  --mu-muted: #6b7781;
  --mu-bg: #f6f7f7;
  --mu-bubble: #eceeee;
  --flag-verde: #0ca30c;
  --flag-amarelo: #fab219;
  --flag-vermelho: #d03b3b;
}
html, body { background: var(--mu-bg); color: var(--mu-ink); }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--mu-primary); }

.btn-mu { background: var(--mu-primary); border-color: var(--mu-primary); color: #fff; font-weight: 600; }
.btn-mu:hover, .btn-mu:focus, .btn-mu:active { background: var(--mu-primary-dark) !important; border-color: var(--mu-primary-dark) !important; color: #fff !important; }
.btn-outline-mu { color: var(--mu-primary); border-color: var(--mu-primary); font-weight: 600; }
.btn-outline-mu:hover, .btn-outline-mu.active { background: var(--mu-primary); color: #fff; }
.text-mu { color: var(--mu-primary) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--mu-primary); box-shadow: 0 0 0 .2rem rgba(35,145,126,.2); }
.form-check-input:checked { background-color: var(--mu-primary); border-color: var(--mu-primary); }

/* Logo */
.mu-logo { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: 1.6rem; color: var(--mu-primary); text-decoration: none; letter-spacing: -.5px; }
.mu-logo .dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: conic-gradient(var(--mu-coral) 0 50%, var(--mu-primary) 50% 100%); display: inline-block; position: relative; }
.mu-logo .dot::after { content: ""; position: absolute; inset: 30%; background: #fff; border-radius: 50%; }
.mu-logo small { font-weight: 400; color: var(--mu-muted); font-size: .8rem; margin-left: .25rem; }
.powered { font-size: .75rem; color: var(--mu-muted); }

/* Auth / cadastro */
.auth-wrap { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 3rem; }
fieldset.mu { border: 1px solid var(--mu-primary); border-radius: .5rem; padding: .75rem 1rem 1rem; margin-bottom: 1.25rem; background: #fff; }
fieldset.mu legend { float: none; width: auto; padding: 0 .4rem; font-size: 1.05rem; color: var(--mu-primary); margin-bottom: .25rem; }
.req::before { content: "* "; color: var(--mu-coral); }
.pwd-rules li { list-style: none; font-size: .85rem; color: var(--mu-coral); }
.pwd-rules li.ok { color: var(--flag-verde); }
.pwd-rules li::before { content: "✕ "; }
.pwd-rules li.ok::before { content: "✓ "; }

/* Chat */
.chat-header { background: #fff; border-bottom: 1px solid #e5e7e8; position: sticky; top: 0; z-index: 10; }
.bot-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--mu-primary-soft); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.progress-mu { height: 8px; background: #dfe3e4; border-radius: 4px; overflow: hidden; }
.progress-mu > div { height: 100%; background: var(--mu-primary); transition: width .4s ease; }
.chat-body { max-width: 860px; margin: 0 auto; padding: 1rem 1rem 14rem; }
.msg { display: flex; margin: .35rem 0; animation: pop .25s ease-out; }
.msg.bot .bubble { background: var(--mu-bubble); color: var(--mu-ink); border-radius: 4px 14px 14px 14px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--mu-primary); color: #fff; border-radius: 14px 4px 14px 14px; }
.msg.user .bubble.editable { cursor: pointer; }
.msg.user .bubble.editable:hover { background: var(--mu-primary-dark); }
.edit-ico { font-size: .75rem; opacity: .55; margin-left: .25rem; }
.msg.user .bubble.editable:hover .edit-ico { opacity: 1; }
.opt-btn.current { background: #fff; color: var(--mu-primary-dark); box-shadow: inset 0 0 0 2px var(--mu-primary); }
.opt-btn.current::after { content: " ✓ atual"; font-weight: 400; font-size: .8rem; }
.scale-btn.current { background: var(--mu-primary); color: #fff; }
.bubble { max-width: min(78%, 520px); padding: .6rem .95rem; line-height: 1.4; white-space: pre-line; }
.bubble .hint { display: block; font-size: .8rem; color: var(--mu-muted); margin-top: .3rem; }
.msg.question .bubble { font-weight: 600; }
.typing .bubble { display: inline-flex; gap: 4px; padding: .8rem 1rem; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa5ab; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3 } 40% { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

.answer-dock { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); border-top: 1px solid #e5e7e8; box-shadow: 0 -4px 18px rgba(0,0,0,.05); z-index: 20; }
.answer-dock .inner { max-width: 860px; margin: 0 auto; padding: .75rem 1rem 1rem; max-height: 55vh; overflow-y: auto; }
.answer-dock .label { font-size: .85rem; font-weight: 600; color: var(--mu-muted); }
.opt-btn { background: var(--mu-primary); color: #fff; border: 0; border-radius: .5rem; padding: .55rem 1rem; font-weight: 600; font-size: .92rem; margin: .2rem; text-align: left; }
.opt-btn:hover { background: var(--mu-primary-dark); }
.opt-chip { border: 1.5px solid var(--mu-primary); color: var(--mu-primary); background: #fff; border-radius: 2rem; padding: .4rem .9rem; margin: .2rem; font-weight: 600; font-size: .9rem; }
.opt-chip.on { background: var(--mu-primary); color: #fff; }
.scale-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--mu-primary); background: #fff; color: var(--mu-primary); font-weight: 700; margin: .15rem; }
.scale-btn:hover { background: var(--mu-primary); color: #fff; }
.link-action { background: none; border: 0; font-size: .85rem; color: var(--mu-muted); padding: 0 .4rem; }
.link-action:hover { color: var(--mu-ink); text-decoration: underline; }

/* Resultado / Mapa */
.score-ring { --v: 0; --c: var(--mu-primary); width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #e4e8e9 0); display: grid; place-items: center; }
.score-ring > div { width: 118px; height: 118px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.score-ring b { font-size: 2.2rem; line-height: 1; }
.flag-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.flag-verde { background: var(--flag-verde); } .flag-amarelo { background: var(--flag-amarelo); } .flag-vermelho { background: var(--flag-vermelho); }
.badge-verde { background: var(--flag-verde) !important; } .badge-amarelo { background: var(--flag-amarelo) !important; color: #222 !important; } .badge-vermelho { background: var(--flag-vermelho) !important; }
.pillar-bar { height: 10px; background: #e4e8e9; border-radius: 5px; overflow: hidden; }
.pillar-bar > div { height: 100%; border-radius: 5px; }
.card-mu { background: #fff; border: 1px solid #e3e6e7; border-radius: .75rem; }
.devolutiva h2 { font-size: 1.1rem; color: var(--mu-primary); margin-top: 1.1rem; }
.devolutiva ul { padding-left: 1.2rem; }

/* Dashboard */
.dash-nav { background: #fff; border-bottom: 1px solid #e3e6e7; }
.kpi { background: #fff; border: 1px solid #e3e6e7; border-radius: .75rem; padding: 1rem 1.1rem; height: 100%; }
.kpi .v { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.kpi .l { font-size: .8rem; color: var(--mu-muted); text-transform: uppercase; letter-spacing: .03em; }
.kpi i { font-size: 1.4rem; color: var(--mu-primary); }
.chart-card { background: #fff; border: 1px solid #e3e6e7; border-radius: .75rem; padding: 1rem; height: 100%; }
.chart-card h6 { font-weight: 700; margin-bottom: .75rem; }
.chart-box { position: relative; height: 260px; }
.table-mu thead th { font-size: .78rem; text-transform: uppercase; color: var(--mu-muted); font-weight: 600; }
.table-mu tbody tr { cursor: pointer; }
.answers-table td { vertical-align: top; font-size: .9rem; }
.answers-table tr.hidden-q { opacity: .45; }

/* Celular: sem painel fixo de respostas - elas rolam junto com a conversa; cabeçalho compacto */
@media (max-width: 767.98px) {
  .chat-header .logo-row { display: none !important; }
  .chat-header .bot-avatar { width: 38px; height: 38px; font-size: 1.15rem; }
  #btnSaveExit .lbl { display: none; }
  .chat-body { padding-bottom: .5rem; }
  .answer-dock { position: static; background: transparent; border-top: 0; box-shadow: none; }
  .answer-dock .inner { max-height: none; overflow: visible; padding: .25rem 1rem 2.5rem; }
}
@media (max-width: 576px) {
  .bubble { max-width: 88%; }
  .opt-btn { width: 100%; margin: .2rem 0; }
}
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
