/* e-PCR — estilos globais. Cores no Theme.cs (MudBlazor); aqui só layout e detalhes. */
html, body { margin: 0; background: #F4F6F5; -webkit-font-smoothing: antialiased; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Valores monetários alinhados */
.mt { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Cartões */
.cartao { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 16px; }
.cartao-hero {
  border-radius: 16px; padding: 20px; color: #fff;
  background: linear-gradient(135deg, #0B7A41 0%, #064E2A 100%);
  box-shadow: 0 8px 24px rgba(11, 122, 65, .25);
}
.cartao-hero .rotulo { opacity: .85; font-size: .85rem; }
.cartao-hero .valor { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .rotulo { color: #475569; font-size: .8rem; font-weight: 500; }
.kpi .valor { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #0F172A; }
.kpi .sub { color: #64748B; font-size: .75rem; }

/* Grelha de acções rápidas */
.accoes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.accao {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; min-height: 44px;
  border-radius: 12px; background: #fff; border: 1px solid #E2E8F0; color: #0F172A; text-decoration: none;
  font-size: .78rem; font-weight: 600; text-align: center;
}
.accao:hover { border-color: #0B7A41; }
.accao .mud-icon-root { color: #0B7A41; }

/* Lista de transacções */
.tx-dia { font-size: .75rem; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F1F5F9; text-decoration: none; color: inherit; }
.tx:last-child { border-bottom: 0; }
.tx .icone { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #E7F4EC; color: #0B7A41; flex: none; }
.tx .meio { flex: 1; min-width: 0; }
.tx .titulo { font-weight: 600; font-size: .92rem; }
.tx .detalhe { color: #64748B; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .direita { text-align: right; }

/* Marca na barra lateral */
.marca { display: flex; align-items: center; gap: 12px; padding: 20px 16px 12px; }
.marca img { width: 40px; height: 40px; border-radius: 10px; background: #000; object-fit: contain; padding: 4px; }
.marca .nome { color: #fff; font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.marca .sub { color: #2BE52B; font-size: .72rem; letter-spacing: .04em; }
.utilizador { margin: 8px 12px 12px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); color: #D7E2DC; }
.utilizador .nome { color: #fff; font-weight: 600; font-size: .9rem; }
.utilizador .perfil { font-size: .75rem; color: #9FB3A8; }
.mud-drawer .mud-nav-link.active { background: rgba(43,229,43,.12) !important; color: #fff !important; }
.mud-drawer .mud-nav-link.active .mud-nav-link-icon { color: #2BE52B !important; }
.mud-drawer .mud-navgroup-title, .mud-drawer .grupo-nav { color: #7C9286; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 16px 16px 4px; }

/* Telemóvel (< 960px): barra inferior com "+" ao centro (BottomNav), sem hamburger nem drawer */
.logo-topo { width: 32px; height: 32px; border-radius: 8px; background: #000; padding: 3px; object-fit: contain; }
@media (min-width: 960px) { .so-mobile-nav, .bn-bar, .bn-fundo, .bn-painel { display: none !important; } }
@media (max-width: 959.98px) {
  .so-desktop-nav, .com-nav-inferior .mud-drawer, .com-nav-inferior .mud-drawer-overlay { display: none !important; }
  .com-nav-inferior .mud-main-content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .bn-bar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300;
    padding: 0 4px env(safe-area-inset-bottom); background: #fff; border-top: 1px solid #E2E8F0; box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    transition: z-index 0s .34s;
  }
  .bn-bar.aberto { z-index: 1352; transition-delay: 0s; }
  .bn-fundo { display: block; position: fixed; inset: 0; z-index: 1350; background: rgba(0,0,0,.4); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .bn-fundo.aberto { opacity: 1; pointer-events: auto; }
  .bn-painel {
    display: block; position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 1351; max-height: 70vh; overflow-y: auto;
    overscroll-behavior: contain; padding: 8px 16px 36px; border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -8px 32px rgba(0,0,0,.18);
    transform: translateY(calc(100% + 80px)); visibility: hidden; transition: transform .34s cubic-bezier(.32,.72,0,1), visibility 0s .34s;
  }
  .bn-painel.aberto { transform: none; visibility: visible; transition-delay: 0s; }
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 60px; min-width: 0; padding: 0;
  border: 0; background: none; color: #64748B; font: inherit; font-size: .68rem; font-weight: 500; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.bn-item.active { color: #0B7A41; font-weight: 700; }
.bn-label { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-centro { justify-content: flex-end; padding-bottom: 6px; }
.bn-fab {
  width: 56px; height: 56px; margin-top: -30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #0B7A41; color: #fff; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(11,122,65,.35); transition: transform .15s ease;
}
.bn-fab .mud-icon-root { font-size: 1.9rem; }
.bn-centro:active .bn-fab { transform: scale(.94); }
.bn-mais-ico { transition: transform .3s cubic-bezier(.32,.72,0,1); }
.bn-item[aria-expanded="true"] .bn-mais-ico { transform: rotate(90deg); }
.bn-pega { width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 2px; background: #E2E8F0; }
.bn-cabecalho { display: flex; align-items: center; gap: 12px; padding: 0 4px 16px; }
.bn-cabecalho-texto { min-width: 0; line-height: 1.25; }
.bn-cabecalho-texto strong { display: block; font-size: 1rem; }
.bn-cabecalho-texto span { display: block; font-size: .78rem; color: #64748B; }
.bn-tile { width: 40px; height: 40px; min-width: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #E7F4EC; color: #0B7A41; }
.bn-grelha { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid #E2E8F0; }
.bn-cartao {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 14px 4px 12px; border-radius: 14px; background: #F4F6F5;
  color: #0F172A; font-size: .75rem; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.bn-cartao.active { background: #E7F4EC; color: #0B7A41; }
.bn-accao { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; border: 0; border-radius: 12px; background: none; color: #0F172A; font: inherit; font-size: .875rem; font-weight: 500; text-align: left; cursor: pointer; }
.bn-accao .bn-tile { width: 34px; height: 34px; min-width: 34px; border-radius: 10px; background: #F1F5F9; color: #475569; }
.bn-accao > span:not(.bn-tile) { flex: 1; }
.bn-painel.aberto .bn-anima { animation: bn-sobe .3s cubic-bezier(.32,.72,0,1) backwards; animation-delay: calc(60ms + var(--i, 0) * 35ms); }
@keyframes bn-sobe { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .bn-bar, .bn-fundo, .bn-painel, .bn-mais-ico { transition: none !important; } .bn-painel.aberto .bn-anima { animation: none; } }

/* Contentor das páginas */
.pagina { max-width: 1600px; margin: 0 auto; padding: 16px; }
@media (min-width: 960px) { .pagina { padding: 24px 32px; } }
.cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cabecalho .sub { color: #64748B; font-size: .9rem; }

/* Login */
.login-fundo { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, #E7F4EC 0%, #F4F6F5 60%); }
.login-cartao { width: 100%; max-width: 420px; }
.login-marca { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; }
.login-marca img { width: 72px; height: 72px; border-radius: 18px; background: #000; padding: 8px; object-fit: contain; }

/* Recibo */
.recibo-ok { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: #E7F4EC; color: #0B7A41; }
.linha-recibo { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #E2E8F0; font-size: .92rem; }
.linha-recibo span:first-child { color: #64748B; }

/* Tabelas: cartões em telemóvel */
@media (max-width: 599.98px) { .so-desktop { display: none !important; } }
@media (min-width: 600px) { .so-mobile { display: none !important; } }

/* Erro do circuito Blazor */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000; padding: 12px 16px; background: #FEF2F2; color: #7F1D1D; border-top: 1px solid #FCA5A5; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* O foco automático no título (FocusOnNavigate) não deve mostrar caixa */
h1:focus { outline: none; }

/* Páginas de ficha/formulário: largura toda, formulário em secções + coluna lateral fixa */
.pagina-larga { max-width: none; }
.ficha-topo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ficha-sub { color: #64748B; font-size: .88rem; }
.etiqueta { font-size: .75rem; font-weight: 600; color: #334155; background: #EEF2F0; border-radius: 6px; padding: 2px 8px; }
.seccao { margin-bottom: 16px; padding: 20px; }
.seccao > header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #F1F5F9; }
.seccao > header .mud-icon-root { color: #0B7A41; background: #E7F4EC; border-radius: 10px; padding: 6px; width: 34px; height: 34px; flex: none; }
.seccao > header h2 { margin: 0; font-size: 1rem; font-weight: 600; color: #0F172A; }
.seccao > header p { margin: 2px 0 0; font-size: .8rem; color: #64748B; }
.coluna-lateral { position: sticky; top: 80px; }
.resumo-linha { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #E2E8F0; font-size: .9rem; }
.resumo-linha span { color: #64748B; }
.resumo-linha.total { border-bottom: 0; font-size: 1rem; }
.resumo-linha.total span { color: #0F172A; font-weight: 600; }
.nota { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: #0E7490; background: #ECFEFF; border-radius: 8px; padding: 10px 12px; }
.passos { margin: 0; padding-left: 20px; line-height: 1.8; color: #334155; font-size: .9rem; }
@media (max-width: 1279.98px) { .coluna-lateral { position: static; } }

/* Diálogo de reconexão */
#components-reconnect-modal { display: none; position: fixed; inset: 0; z-index: 3000; background: rgba(11, 20, 17, .55); backdrop-filter: blur(3px); place-items: center; padding: 16px; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: grid; }
.reconexao-cartao { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); font-family: Inter, system-ui, sans-serif; }
.reconexao-cartao img { border-radius: 14px; background: #000; margin-bottom: 12px; }
.reconexao-estado { display: none; flex-direction: column; gap: 6px; align-items: center; color: #475569; font-size: .9rem; }
.reconexao-estado strong { color: #0F172A; font-size: 1.05rem; }
.components-reconnect-show .a-ligar, .components-reconnect-failed .falhou, .components-reconnect-rejected .expirou { display: flex; }
.reconexao-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #E7F4EC; border-top-color: #0B7A41; animation: girar .8s linear infinite; margin-bottom: 6px; }
.reconexao-estado button { margin-top: 10px; border: 0; border-radius: 10px; background: #0B7A41; color: #fff; font-weight: 600; padding: 10px 18px; cursor: pointer; font-family: inherit; }
@keyframes girar { to { transform: rotate(360deg); } }

/* KPI: todos os cartões da fila com a mesma altura; valor numa só linha */
.kpi { height: 100%; display: flex; flex-direction: column; }
.kpi .valor { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { margin-top: auto; padding-top: 2px; }
.cartao > .mud-chart, .cartao .mud-chart { width: 100% !important; }

/* Menu da conta (padrão eBill, adaptado à appbar clara) */
.cm-btn { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 3px; border: 1px solid #E2E8F0; border-radius: 999px; background: #fff; color: #475569; cursor: pointer; transition: background .2s ease, box-shadow .2s ease; -webkit-tap-highlight-color: transparent; }
.cm-btn:hover { background: #F4F6F5; }
.cm-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0B7A41, #064E2A); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .5px; transition: box-shadow .25s ease; }
.cm-btn.aberto .cm-avatar { box-shadow: 0 0 0 3px rgba(11,122,65,.2); }
.cm-seta { transition: transform .28s cubic-bezier(.32,.72,0,1); }
.cm-btn.aberto .cm-seta { transform: rotate(180deg); }
.cm-fundo { position: fixed; inset: 0; z-index: 1298; background: transparent; pointer-events: none; }
.cm-fundo.aberto { pointer-events: auto; }
.cm-painel {
  position: fixed; top: calc(var(--mud-appbar-height) + 6px); right: 12px; z-index: 1299; width: 320px; max-height: calc(100vh - 80px); overflow-y: auto;
  border-radius: 16px; background: #fff; color: #0F172A; border: 1px solid #E2E8F0; box-shadow: 0 18px 48px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.06);
  transform-origin: top right; opacity: 0; transform: translateY(-8px) scale(.96); visibility: hidden;
  transition: opacity .2s ease, transform .28s cubic-bezier(.32,.72,0,1), visibility 0s .28s;
}
.cm-painel:focus { outline: none; }
.cm-painel.aberto { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
@media (max-width: 599.98px) {
  .cm-seta { display: none; }
  .cm-btn { padding: 2px; border: 0; }
  .cm-fundo { background: rgba(0,0,0,.35); opacity: 0; transition: opacity .25s ease; }
  .cm-fundo.aberto { opacity: 1; }
  .cm-painel {
    top: var(--mud-appbar-height); left: 0; right: 0; width: auto; max-height: calc(100vh - 140px); border: 0; border-radius: 0 0 20px 20px;
    box-shadow: 0 12px 32px rgba(0,0,0,.2); opacity: 1; transform: translateY(-110%); transition: transform .32s cubic-bezier(.32,.72,0,1), visibility 0s .32s;
  }
}
.cm-cabecalho { display: flex; align-items: center; gap: 12px; padding: 18px 16px 16px; background: linear-gradient(180deg, #E7F4EC, transparent); }
.cm-cabecalho-avatar { width: 46px; height: 46px; min-width: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0B7A41, #064E2A); color: #fff; font-size: 1rem; font-weight: 700; box-shadow: 0 4px 12px rgba(11,122,65,.3); }
.cm-cabecalho-texto { min-width: 0; line-height: 1.3; }
.cm-cabecalho-texto strong { display: block; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-email { display: block; font-size: .76rem; color: #64748B; }
.cm-perfil { display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: 999px; font-size: .66rem; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; background: rgba(11,122,65,.12); color: #0B7A41; }
.cm-grupo { padding: 6px 8px; border-top: 1px solid #E2E8F0; }
.cm-linha { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; font-size: .875rem; font-weight: 500; text-align: left; text-decoration: none; -webkit-tap-highlight-color: transparent; transition: background .18s ease; }
a.cm-linha, button.cm-linha { cursor: pointer; }
a.cm-linha:hover, button.cm-linha:hover, .cm-linha:focus-visible { background: #F4F6F5; outline: none; }
.cm-linha.active { background: rgba(11,122,65,.1); color: #0B7A41; }
.cm-tile { width: 34px; height: 34px; min-width: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(11,122,65,.1); color: #0B7A41; }
.cm-linha-texto { flex: 1; min-width: 0; line-height: 1.25; }
.cm-linha-texto small { display: block; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #64748B; }
.cm-linha-texto span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-dica { font-size: .75rem; font-weight: 600; color: #0B7A41; }
.cm-chevron { opacity: .45; transition: opacity .18s ease; }
.cm-linha:hover .cm-chevron { opacity: .8; }
.cm-sair { color: #B91C1C; }
.cm-sair .cm-tile { background: rgba(185,28,28,.1); color: #B91C1C; }
button.cm-sair:hover { background: rgba(185,28,28,.08); }
.cm-painel.aberto .cm-anima { animation: cm-desce .3s cubic-bezier(.32,.72,0,1) backwards; animation-delay: calc(40ms + var(--i, 0) * 30ms); }
@keyframes cm-desce { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .cm-painel, .cm-fundo, .cm-seta, .cm-avatar, .cm-chevron { transition: none !important; } .cm-painel.aberto .cm-anima { animation: none; } }

/* Chip do saldo de SMS */
.saldo-sms { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; text-decoration: none; border: 1px solid #E2E8F0; color: #475569; background: #fff; white-space: nowrap; }
.saldo-sms.verde { color: #15803D; background: #F0FDF4; border-color: #BBF7D0; }
.saldo-sms.ambar { color: #B45309; background: #FFFBEB; border-color: #FDE68A; }
.saldo-sms.vermelho { color: #B91C1C; background: #FEF2F2; border-color: #FECACA; }
.saldo-sms.cinza { color: #64748B; background: #F1F5F9; }

/* Vídeo de ajuda e guia de boas-vindas */
.va-fundo { position: fixed; inset: 0; z-index: 1400; background: rgba(11,20,17,.55); backdrop-filter: blur(2px); }
.va-painel { position: fixed; z-index: 1401; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.va-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.va-titulo { font-weight: 700; font-size: 1.05rem; color: #0F172A; }
.va-sub { font-size: .82rem; color: #64748B; }
.va-video { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 12px; background: #0B1411; margin: 8px 0 12px; }
.va-passos { margin: 0 0 8px; padding-left: 20px; line-height: 1.7; color: #334155; font-size: .9rem; }
.ob-cabecalho { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.ob-cabecalho img { border-radius: 10px; background: #000; padding: 3px; }
.ob-icone { display: grid; place-items: center; height: 120px; border-radius: 12px; background: #E7F4EC; color: #0B7A41; margin: 8px 0 12px; }
.ob-titulo-passo { font-weight: 600; color: #0F172A; margin-top: 2px; }
.ob-pontos { display: flex; justify-content: center; gap: 6px; margin: 10px 0 12px; }
.ob-pontos span { width: 8px; height: 8px; border-radius: 50%; background: #CBD5E1; }
.ob-pontos span.activo { width: 22px; border-radius: 4px; background: #0B7A41; }
@media (max-width: 599.98px) { .va-painel { top: auto; bottom: 0; left: 0; transform: none; width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; } }
.pp-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F1F5F9; flex-wrap: wrap; }
.pp-item:last-child { border-bottom: 0; }
.pp-texto { flex: 1; min-width: 160px; font-size: .9rem; }
.pp-item.feito .pp-texto { color: #64748B; text-decoration: line-through; }

/* Mapa "Como funciona" (MapaFluxo.razor) */
.mf-separadores { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.mf-sep { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 1px solid #E2E8F0; background: #fff; color: #334155; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.mf-sep.activo { background: #0B7A41; border-color: #0B7A41; color: #fff; }
.mf-sep.brevemente:not(.activo) { color: #94A3B8; border-style: dashed; }
.mf-selo { font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; background: #F1F5F9; color: #64748B; }
.mf-grelha { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.mf-diagrama { overflow-x: auto; }
.mf-diagrama svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.mf-brevemente svg { opacity: .8; }
.mf-brevemente .mf-no rect { stroke-dasharray: 5 4; }
.mf-cartao { position: sticky; top: 72px; }
.mf-seguir { margin: 14px 0 6px; }
.mf-ramo { justify-content: space-between; text-transform: none; }
@media (max-width: 899.98px) { .mf-grelha { grid-template-columns: 1fr; } .mf-cartao { position: static; } }

/* Cores por actor */
.mf-no { --c: #64748B; --f: #F8FAFC; cursor: pointer; outline: none; }
.membro { --c: #0B7A41; --f: #E7F4EC; } .resp { --c: #2563EB; --f: #EFF6FF; } .grupo { --c: #0891B2; --f: #ECFEFF; }
.ofec { --c: #7C3AED; --f: #F5F3FF; } .sistema { --c: #64748B; --f: #F8FAFC; } .vitae { --c: #D97706; --f: #FFFBEB; }
.mf-no rect { fill: var(--f); stroke: var(--c); stroke-width: 1.5; transition: stroke-width .15s, filter .15s; }
.mf-no:hover rect, .mf-no:focus-visible rect { stroke-width: 2.5; }
.mf-no.actual rect { stroke-width: 3; filter: drop-shadow(0 4px 10px rgba(15,23,42,.18)); }
.mf-no:not(.visto) { opacity: .85; }
.mf-titulo { font-size: 12.5px; font-weight: 600; fill: #0F172A; pointer-events: none; }
.mf-estado { font-size: 10.5px; fill: var(--c); font-weight: 600; pointer-events: none; }
.mf-consigo { fill: #F59E0B; }
.mf-aresta { fill: none; stroke: #CBD5E1; stroke-width: 1.5; stroke-dasharray: 4 4; }
.mf-aresta.saida { stroke: #64748B; stroke-dasharray: 6 3; }
.mf-aresta.on { stroke: #0B7A41; stroke-width: 2.5; stroke-dasharray: none; }
.mf-aresta.nova { stroke-dasharray: 600; stroke-dashoffset: 600; animation: mf-traco .6s ease-out forwards; }
@keyframes mf-traco { to { stroke-dashoffset: 0; } }
.mf-rotulo { font-size: 10.5px; fill: #64748B; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.mf-rotulo.on { fill: #0B7A41; font-weight: 600; }
.mf-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .75rem; color: #475569; }
.mf-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--f); border: 2px solid var(--c); }
.mf-legenda i.mf-ponto { border-radius: 50%; background: #F59E0B; border-color: #F59E0B; }
.mf-actor { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--c); background: var(--f); border: 1px solid var(--c); }
.mf-actor.consigo { color: #B45309; background: #FFFBEB; border-color: #FCD34D; }
@media (prefers-reduced-motion: reduce) { .mf-aresta.nova { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; } .mf-no rect { transition: none; } }
