/* ══════════════════════════════════════════════════════════════════════════
   GUIA DA PLATAFORMA — estilos
   Usa exclusivamente os tokens de themes.css (--accent, --sf-*, --fg-*).
   Sem cor literal fora de rgba() de sombreamento → os 4 temas funcionam.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Máscara: 4 retângulos em volta do alvo. O "buraco" é vazio de verdade,
      então o elemento destacado continua clicável sem truque de pointer-events. */
.lmg-mask {
  position: fixed;
  background: var(--sombra);
  z-index: 9000;
  transition: all .28s cubic-bezier(.2, .85, .25, 1);
}
.lmg-mask--off { opacity: 0; pointer-events: none; }

/* ── Anel do alvo */
.lmg-ring {
  position: fixed;
  z-index: 9001;
  pointer-events: none;
  border-radius: 12px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent),
              0 0 28px color-mix(in srgb, var(--accent) 38%, transparent);
  transition: all .28s cubic-bezier(.2, .85, .25, 1);
  animation: mdgPulse 2.4s ease-in-out infinite;
}
@keyframes mdgPulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent); }
  50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 10%, transparent), 0 0 34px color-mix(in srgb, var(--accent) 45%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .lmg-ring { animation: none; }
  .lmg-mask, .lmg-ring, .lmg-card { transition: none; }
}

/* ── Card de instrução */
.lmg-card {
  position: fixed;
  z-index: 9002;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--sf-card);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border2));
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 18px 50px var(--sombra);
  font-family: 'Work Sans', -apple-system, sans-serif;
  transition: all .28s cubic-bezier(.2, .85, .25, 1);
}
.lmg-card__eyebrow {
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 7px;
}
.lmg-card__titulo { font-size: 15px; font-weight: 700; color: var(--fg); margin-bottom: 7px; line-height: 1.35; }
.lmg-card__corpo  { font-size: 12.5px; color: var(--fg-soft3); line-height: 1.62; margin-bottom: 14px; }

.lmg-card__rodape { display: flex; align-items: center; gap: 8px; }
.lmg-card__passo  { font-size: 11px; color: var(--fg-subtle); flex: 1; font-variant-numeric: tabular-nums; }

.lmg-btn {
  padding: 7px 13px; border-radius: 9px; font-size: 11.5px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all .18s;
  background: var(--sf-well); border: 1px solid var(--border2); color: var(--fg-soft3);
}
.lmg-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--fg); }
.lmg-btn:disabled { opacity: .35; cursor: default; }
.lmg-btn--primario { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.lmg-btn--primario:hover { filter: brightness(1.1); color: var(--accent-fg); }
.lmg-btn:focus-visible, .lmg-fab:focus-visible, .lmg-acao:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ── Barra de progresso do tour */
.lmg-prog { height: 3px; background: var(--sf-well); border-radius: 99px; overflow: hidden; margin-bottom: 13px; }
.lmg-prog__fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }

/* ── Botão de ajuda flutuante (canto superior direito, abaixo da topbar) */
.lmg-fab {
  position: fixed; top: 58px; right: 22px; z-index: 8500;
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--sf-well); border: 1px solid var(--border2);
  color: var(--fg-muted); font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.lmg-fab:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); }
.lmg-fab[data-novo="1"]::after {
  content: ''; position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

/* ── Painel lateral (Modo Exploração) */
.lmg-painel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw;
  z-index: 9100; background: var(--sf-deep); border-left: 1px solid var(--border2);
  box-shadow: -18px 0 50px var(--sombra);
  display: flex; flex-direction: column;
  font-family: 'Work Sans', -apple-system, sans-serif;
  transform: translateX(0); transition: transform .3s cubic-bezier(.2, .85, .25, 1);
}
.lmg-painel--fechado { transform: translateX(105%); }
.lmg-painel__topo {
  padding: 16px 18px; border-bottom: 1px solid var(--border2);
  display: flex; align-items: flex-start; gap: 12px; flex-shrink: 0;
}
.lmg-painel__fase { font-size: 9.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.lmg-painel__nome { font-size: 17px; font-weight: 700; color: var(--fg); line-height: 1.25; }
.lmg-painel__corpo { flex: 1; overflow-y: auto; padding: 18px; }
.lmg-painel__x {
  background: transparent; border: 1px solid var(--border2); border-radius: 9px;
  width: 28px; height: 28px; color: var(--fg-subtle); cursor: pointer; font-size: 15px;
  flex-shrink: 0; font-family: inherit;
}
.lmg-painel__x:hover { color: var(--fg); border-color: var(--sf-strong); }

.lmg-sec { margin-bottom: 22px; }
.lmg-sec__t {
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--fg-subtle); margin-bottom: 9px;
}
.lmg-valor { font-size: 13px; color: var(--fg-soft3); line-height: 1.65; }

.lmg-benef { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.lmg-benef li {
  font-size: 12.5px; color: var(--fg-soft3); line-height: 1.5;
  padding-left: 18px; position: relative;
}
.lmg-benef li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

.lmg-faq { border-top: 1px solid var(--border2); padding: 11px 0; }
.lmg-faq:last-child { border-bottom: 1px solid var(--border2); }
.lmg-faq__p { font-size: 12.5px; font-weight: 600; color: var(--fg); cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.lmg-faq__p span { color: var(--accent); flex-shrink: 0; }
.lmg-faq__r { font-size: 12px; color: var(--fg-soft4); line-height: 1.6; margin-top: 8px; padding-left: 18px; display: none; }
.lmg-faq[open] .lmg-faq__r, .lmg-faq--aberto .lmg-faq__r { display: block; }

/* ── Ações da IA: dois níveis visualmente distintos (Regra 13) */
.lmg-acao {
  width: 100%; text-align: left; display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 12px; border-radius: 10px; margin-bottom: 8px;
  font-family: inherit; font-size: 12.5px; line-height: 1.45; cursor: pointer;
  background: var(--sf-well); border: 1px solid var(--border2); color: var(--fg-soft3);
  transition: all .18s;
}
.lmg-acao:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--fg); }
.lmg-acao__ic { flex-shrink: 0; font-size: 13px; line-height: 1.3; }
.lmg-acao--bloqueada {
  cursor: default; opacity: .92;
  background: color-mix(in srgb, var(--warning) 5%, transparent);
  border: 1px dashed color-mix(in srgb, var(--warning) 38%, transparent);
  border-radius: 10px;
  flex-direction: column; gap: 6px;
}
.lmg-acao--bloqueada:hover { border-color: color-mix(in srgb, var(--warning) 38%, transparent); color: var(--fg-soft3); }
.lmg-acao__hitl {
  font-size: 11px; color: var(--warning); line-height: 1.55;
  padding-left: 22px; font-weight: 500;
}
.lmg-acao__tag {
  font-size: 8.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  border-radius: 5px; padding: 1px 5px; margin-left: 6px;
}

/* ── Aviso de estado (tela incompleta / com pré-requisito) */
.lmg-aviso {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 12px; margin-bottom: 20px; border-radius: 10px;
  background: color-mix(in srgb, var(--warning) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 34%, transparent);
  color: var(--warning); font-size: 12px; line-height: 1.55; font-weight: 500;
}

/* ── Rodapé do painel */
.lmg-painel__base { padding: 14px 18px; border-top: 1px solid var(--border2); flex-shrink: 0; display: flex; gap: 8px; }

/* ── Toast de conclusão */
.lmg-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 9200; padding: 11px 20px; border-radius: 11px;
  background: var(--sf-card); border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent);
  color: var(--fg); font-size: 12.5px; font-family: 'Work Sans', sans-serif; font-weight: 600;
  box-shadow: 0 12px 36px var(--sombra);
}

/* ── Mobile: card vira faixa fixa inferior (requisito do documento original) */
@media (max-width: 720px) {
  .lmg-card {
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; border-bottom: none;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .lmg-fab { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); right: 14px; }

  /* Em tela de telefone a gaveta ocupa tudo. Sem a safe area o cabeçalho do
     painel passa por baixo do relógio e do notch; sem o box-sizing a largura
     de 100% mais o padding estoura o conteúdo para fora da borda direita —
     os dois apareceram no iPhone e não no desktop. */
  .lmg-painel {
    width: 100%; max-width: 100%; box-sizing: border-box;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .lmg-painel > * { box-sizing: border-box; max-width: 100%; }
}

/* ── Leitor de tela */
.lmg-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
