/* maturidade-mosaic.css — estilos do relatório personalizado por IA.
   Tipografia "revista" (Stratechery/Economist). Cada section.type tem visual próprio. */

/* O container do mosaico estoura o limite do .mat-container (720px) */
.mat-container.mat-container-mosaic {
  max-width: min(1280px, 96vw) !important;
  padding-left: clamp(20px, 4vw, 56px) !important;
  padding-right: clamp(20px, 4vw, 56px) !important;
}
/* mobile: cards quase full-screen — margem externa quase zerada pra
   sobrar mais espaço interno dentro dos cards */
@media (max-width: 700px) {
  .mat-container.mat-container-mosaic {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

.mat-mosaic {
  --mx-orange: var(--mat-orange, #ff6b00);
  --mx-orange-soft: #ff8c3a;
  --mx-gold: #ffc24b;
  --mx-line: rgba(255,255,255,0.08);
  --mx-dim: rgba(255,255,255,0.62);
  --mx-card: rgba(255,255,255,0.03);
  --mx-card-strong: rgba(255,255,255,0.05);
  --mx-ease: cubic-bezier(.22,1,.36,1);

  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  margin: 0 auto;
  padding: 0 0 60px;
}

/* spans default (mobile primeiro) */
.mat-mx { grid-column: 1 / -1; }

/* desktop: layout editorial com larguras variadas */
@media (min-width: 920px) {
  .mat-mx-hero               { grid-column: 1 / -1; }
  .mat-mx-narrative          { grid-column: span 8; }
  .mat-mx-narrative + .mat-mx-pullquote { grid-column: span 4; align-self: center; }
  .mat-mx-pullquote          { grid-column: span 5; }
  .mat-mx-stats              { grid-column: 1 / -1; }
  .mat-mx-radar              { grid-column: span 6; }
  .mat-mx-dimbars            { grid-column: span 6; }
  .mat-mx-strengths-weaknesses, .mat-mx-sw { grid-column: 1 / -1; }
  .mat-mx-tension            { grid-column: 1 / -1; }
  .mat-mx-source             { grid-column: span 6; }
  .mat-mx-movement           { grid-column: span 6; }
  .mat-mx-imagetext          { grid-column: 1 / -1; }
  .mat-mx-cta                { grid-column: 1 / -1; }
}

/* ===== HEADER + FOOTER ===== */
.mat-mosaic-head {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--mx-line);
  padding-bottom: 24px;
  margin-bottom: 8px;
}
.mat-mosaic-title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fff 0%, #ffd9b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mat-mosaic-subtitle {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  color: var(--mx-dim);
  line-height: 1.5;
  max-width: 70ch;
}
.mat-mosaic-refs {
  grid-column: 1 / -1;
  margin-top: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--mx-line);
}
.mx-refs-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px 18px;
  font-size: 0.85rem; color: var(--mx-dim);
}
.mx-refs-list li { padding: 4px 0; }
.mx-refs-list b { color: #fff; font-weight: 600; }
.mx-refs-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mx-dim); font-weight: 700;
  margin-bottom: 10px;
}

/* ===== Comum ===== */
.mat-mx {
  position: relative;
}
.mx-section-eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mx-dim);
  margin-bottom: 12px;
}
.mx-section-eyebrow .hl { color: var(--mx-orange); }
.mx-ev-chip {
  display: inline-block;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.7rem;
  background: rgba(255,107,0,0.1);
  border: 1px solid rgba(255,107,0,0.3);
  color: #ffbf80;
  padding: 2px 8px;
  border-radius: 6px;
  margin: 2px 4px 2px 0;
}
.mx-ev-row { margin-top: 8px; }

/* ===== 1. HERO ARQUETIPO — full-bleed dramático ===== */
.mat-mx-hero {
  text-align: center;
  padding: 48px 24px 56px;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,107,0,0.18), transparent 60%),
              linear-gradient(180deg, rgba(255,107,0,0.04), transparent 60%);
  border-radius: 24px;
  border: 1px solid var(--mx-line);
  position: relative;
  overflow: hidden;
}
.mat-mx-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,194,75,0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255,107,0,0.06), transparent 50%);
  pointer-events: none;
}
.mat-mx-hero > * { position: relative; z-index: 1; }
.mx-hero-eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--mx-orange);
  margin-bottom: 12px;
}
.mx-hero-arq {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #ffd9b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mx-hero-tagline {
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: var(--mx-dim);
  max-width: 38ch;
  margin: 12px auto 0;
  line-height: 1.5;
}
.mx-hero-scores {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  margin-top: 28px;
}
.mx-score-card {
  background: var(--mx-card); border: 1px solid var(--mx-line); border-radius: 16px;
  padding: 18px 24px; min-width: 140px;
}
.mx-score-card .v {
  font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--mx-orange);
}
.mx-score-card .v small { font-size: 0.6em; color: var(--mx-dim); margin-left: 2px; }
.mx-score-card .k {
  margin-top: 8px; font-size: 0.82rem; color: var(--mx-dim); letter-spacing: 0.05em;
}

/* ===== 2. PULL QUOTE ===== */
.mat-mx-pullquote {
  padding: 26px 28px;
  background: linear-gradient(135deg, rgba(255,107,0,0.08), transparent 70%);
  border-left: 3px solid var(--mx-orange);
  border-radius: 12px;
  position: relative;
}
.mx-pq-mark {
  position: absolute; top: -10px; left: 14px;
  font-size: 5rem; line-height: 1; color: rgba(255,107,0,0.2);
  font-family: Georgia, serif; font-weight: 900;
}
.mx-pq-stat {
  font-size: clamp(1.2rem, 1.8vw, 1.65rem);
  font-weight: 600; line-height: 1.35;
  color: #fff;
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}
.mx-pq-cite {
  display: block;
  margin-top: 14px;
  font-size: 0.88rem; color: var(--mx-dim);
  font-style: normal;
}

/* ===== 3. STAT BLOCK ===== */
.mat-mx-stats {
  display: grid;
  gap: 16px;
}
.mat-mx-stats[data-cols="1"] { grid-template-columns: 1fr; }
.mat-mx-stats[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.mat-mx-stats[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.mat-mx-stats[data-cols="4"] { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) {
  .mat-mx-stats[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
}
.mx-stat {
  background: var(--mx-card); border: 1px solid var(--mx-line);
  border-radius: 14px; padding: 20px;
  text-align: center;
}
.mx-stat-v {
  font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 800; line-height: 1;
  color: var(--mx-orange);
}
.mx-stat-l {
  margin-top: 8px; font-size: 0.92rem; line-height: 1.35; color: #fff;
}
.mx-stat-c {
  margin-top: 6px; font-size: 0.78rem; color: var(--mx-dim); font-style: italic;
}

/* ===== 4. NARRATIVE ===== */
.mat-mx-narrative {
  max-width: 64ch;
}
.mx-narrative-title {
  font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 800;
  letter-spacing: -0.01em; line-height: 1.2;
  margin-bottom: 14px;
}
.mx-narrative-body p {
  font-size: 1.02rem; line-height: 1.65; margin-bottom: 14px;
  color: rgba(255,255,255,0.86);
}
.mx-narrative-body p:last-child { margin-bottom: 0; }
.mx-narrative-body p:first-of-type::first-letter {
  font-size: 2.6em; font-weight: 800; float: left;
  line-height: 0.85; margin: 6px 8px 0 0;
  color: var(--mx-orange);
}

/* ===== 5. IMAGE + TEXT ===== */
.mat-mx-imagetext {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
  background: var(--mx-card); border: 1px solid var(--mx-line);
  border-radius: 16px; padding: 24px;
}
@media (min-width: 700px) {
  .mat-mx-imagetext { grid-template-columns: 180px 1fr; }
  .mat-mx-imagetext[data-lado="right"] {
    grid-template-columns: 1fr 180px;
  }
  .mat-mx-imagetext[data-lado="right"] .mx-it-visual { order: 2; }
}
.mx-it-visual {
  display: grid; place-items: center;
  font-size: 4.5rem;
  color: var(--mx-orange);
  background: radial-gradient(circle, rgba(255,107,0,0.12), transparent 70%);
  aspect-ratio: 1;
  border-radius: 50%;
}
.mx-it-title {
  font-size: 1.2rem; font-weight: 800; margin-bottom: 8px;
}
.mx-it-text {
  color: rgba(255,255,255,0.84); line-height: 1.55;
}

/* ===== 6. RADAR ORG (placeholder, hidratado por drawRadar) ===== */
.mat-mx-radar .mat-radar-wrap {
  max-width: 480px; margin: 0 auto;
}

/* ===== 7. DIM BARS (placeholder) ===== */
.mat-mx-dimbars .mat-dims-list {
  /* herda do CSS principal */
}

/* ===== 8. ANÁLISE POR PILAR — 1 card por pilar; radar colorido pela nota; sustenta/destravar ===== */
.mat-mx-sw { display: flex; flex-direction: column; gap: 20px; }

.mat-sw-card {
  position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: start;
  padding: 24px; border-radius: 14px; border: 1px solid var(--mx-line);
  background: var(--mx-card); overflow: hidden;
  transition: border-color .35s var(--mx-ease), transform .35s var(--mx-ease);
}
.mat-sw-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .4s var(--mx-ease);
  background: radial-gradient(ellipse 60% 80% at 12% 30%, var(--card-glow), transparent 60%);
}
.mat-sw-card:hover { transform: translateY(-2px); border-color: var(--card-border); }
.mat-sw-card:hover::before { opacity: 1; }
/* cor do card pela faixa da nota */
.mat-sw-card[data-band="red"]    { --card-accent: #ff5b5b; --card-border: rgba(255,91,91,.35);  --card-glow: rgba(255,91,91,.10); }
.mat-sw-card[data-band="yellow"] { --card-accent: #f5c451; --card-border: rgba(245,196,81,.35); --card-glow: rgba(245,196,81,.09); }
.mat-sw-card[data-band="green"]  { --card-accent: #34d399; --card-border: rgba(52,211,153,.35); --card-glow: rgba(52,211,153,.10); }

.mat-sw-radar { position: relative; width: 200px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mat-sw-radar svg { width: 100%; height: auto; display: block; overflow: visible; }
.mat-sw-score {
  font-family: 'SF Mono', Menlo, monospace; font-size: 10px; color: var(--mx-faint, rgba(255,255,255,.34));
  letter-spacing: .04em; white-space: nowrap;
}
.mat-sw-score b { color: var(--card-accent); font-size: 12px; }

.mat-sw-body { position: relative; z-index: 1; }
.mat-sw-tag {
  font-family: 'SF Mono', Menlo, monospace; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--card-accent); margin-bottom: 6px; display: inline-block;
}
.mat-sw-body h4 { font-size: 0.98rem; font-weight: 800; line-height: 1.25; margin: 2px 0 12px; letter-spacing: -.01em; }

/* sub-blocos: o que sustenta (verde) / o que destravar (vermelho) — fontes mínimas */
.mat-sw-part + .mat-sw-part { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--mx-line); }
.mat-sw-part-lbl {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
  margin-bottom: 6px;
}
.mat-sw-part-lbl::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.mat-sw-part-up   .mat-sw-part-lbl { color: #34d399; }
.mat-sw-part-up   .mat-sw-part-lbl::before { background: #34d399; }
.mat-sw-part-down .mat-sw-part-lbl { color: #ff5b5b; }
.mat-sw-part-down .mat-sw-part-lbl::before { background: #ff5b5b; }
.mat-sw-part p { margin: 0; font-size: 0.82rem; line-height: 1.55; color: var(--mx-dim); }
.mat-sw-part p b { color: #fff; }

/* código da pergunta (PRO01): mantém o código, hover/toque mostra a pergunta */
.mat-qref {
  text-decoration: none; cursor: help; font-weight: 600; color: var(--card-accent, var(--mx-orange));
  border-bottom: 1px dotted currentColor; white-space: nowrap;
}
/* tooltip instantâneo (sem o delay do title nativo) */
.mat-qref-tip {
  position: absolute; z-index: 95; display: none;
  background: rgba(18,18,24,0.97); color: #f4f4f6;
  border: 1px solid rgba(255,255,255,0.14); border-radius: 10px;
  padding: 10px 13px; font-size: 13px; line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  pointer-events: none;
}

/* quebra mais cedo (≤700px): radar em cima, texto embaixo — não amassa o texto */
@media (max-width: 700px) {
  .mat-sw-card { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; }
  .mat-sw-body { text-align: left; width: 100%; }
  .mat-sw-radar { width: 190px; }
}

/* ===== 9. SOURCE CARD ===== */
.mat-mx-source {
  background: linear-gradient(180deg, rgba(255,107,0,0.06), transparent 60%);
  border: 1px solid rgba(255,107,0,0.25);
  border-radius: 16px; padding: 26px;
}
.mx-src-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 700; color: var(--mx-orange);
  margin-bottom: 14px;
}
.mx-src-title {
  font-size: 1.15rem; font-weight: 800; margin-bottom: 10px;
}
.mx-src-quote {
  font-size: 1.1rem; font-style: italic; line-height: 1.5;
  margin: 0 0 14px; color: rgba(255,255,255,0.92);
  border-left: none; padding: 0;
}
.mx-src-cite {
  font-style: normal;
  font-size: 0.86rem; color: var(--mx-dim);
}
.mx-src-cite code {
  background: rgba(255,255,255,0.05); padding: 1px 6px; border-radius: 4px;
  font-family: 'SF Mono', Menlo, monospace; font-size: 0.78rem;
}

/* ===== 10. MOVEMENT CARD — card editorial 2 por linha ===== */
.mat-mx-movement {
  background: linear-gradient(180deg, var(--mx-card-strong), var(--mx-card) 100%);
  border: 1px solid var(--mx-line);
  border-radius: 18px; padding: 26px 24px;
  position: relative;
  transition: border-color 200ms var(--mx-ease), transform 200ms var(--mx-ease);
  display: flex; flex-direction: column;
}
.mat-mx-movement:hover {
  border-color: rgba(255,107,0,0.45);
  transform: translateY(-2px);
}
.mat-mx-movement[data-impacto="transformacional"] { border-left: 4px solid var(--mx-orange); }
.mat-mx-movement[data-impacto="alto"] { border-left: 4px solid #ffb84d; }
.mat-mx-movement[data-impacto="medio"] { border-left: 4px solid rgba(255,255,255,0.4); }
.mx-mv-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 700; color: var(--mx-dim); margin-bottom: 6px;
}
.mx-mv-nivel { color: var(--mx-orange); }
.mx-mv-title {
  font-size: 1.3rem; font-weight: 800; line-height: 1.25;
  margin-bottom: 14px;
}
.mx-mv-why {
  color: rgba(255,255,255,0.86); font-size: 0.96rem; line-height: 1.55;
  margin-bottom: 16px;
}
.mx-mv-why b { color: var(--mx-orange); font-weight: 700; }
.mx-mv-how {
  background: rgba(0,0,0,0.25); border-radius: 10px; padding: 14px 16px;
  margin-bottom: 14px;
}
.mx-mv-how-row {
  display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: baseline;
  padding: 6px 0;
}
.mx-mv-how-row + .mx-mv-how-row { border-top: 1px solid var(--mx-line); }
.mx-mv-how-row .lbl {
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mx-orange); font-weight: 700;
}
.mx-mv-how-row .txt { font-size: 0.94rem; line-height: 1.45; }
.mx-mv-meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  font-size: 0.78rem;
}
.mx-mv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--mx-line);
  color: var(--mx-dim);
  font-weight: 600;
}
.mx-mv-impacto-transformacional { color: var(--mx-orange); border-color: rgba(255,107,0,0.5); background: rgba(255,107,0,0.1); }
.mx-mv-impacto-alto { color: #ffb84d; }
.mx-mv-esforco-baixo { color: #6fe0a0; }
.mx-mv-esforco-alto { color: #ff8c8c; }
.mx-mv-pilares { color: var(--mx-dim); }
.mx-mv-pilar {
  display: inline-block; background: rgba(255,255,255,0.06); padding: 2px 7px; border-radius: 4px;
  font-family: 'SF Mono', Menlo, monospace; font-size: 0.72rem;
  margin: 0 2px;
}

/* mobile: a coluna fixa de 90px amassa o texto de "1ª semana / 1º mês" —
   empilha o rótulo em cima do texto e usa a largura toda */
@media (max-width: 700px) {
  .mx-mv-how-row {
    grid-template-columns: 1fr; gap: 4px;
  }
  .mx-mv-how { padding: 12px 14px; }
  .mat-mx-movement { padding: 22px 18px; }
}

/* ===== 11. TENSION — full-bleed, layout em 3 colunas ===== */
.mat-mx-tension {
  background: linear-gradient(135deg, rgba(255,107,0,0.1), rgba(255,107,0,0.02) 80%);
  border: 1px solid rgba(255,107,0,0.35);
  border-radius: 20px; padding: 32px;
  position: relative;
  overflow: hidden;
}
.mat-mx-tension::before {
  content: '⚡';
  position: absolute; top: 12px; right: 20px;
  font-size: 3.5rem; opacity: 0.08;
  color: var(--mx-orange);
}
.mx-tn-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 700; color: var(--mx-orange);
  margin-bottom: 12px;
}
.mx-tn-title {
  font-size: 1.3rem; font-weight: 800; line-height: 1.25;
  margin-bottom: 16px;
}
.mx-tn-axes {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 14px;
  background: rgba(0,0,0,0.3); border-radius: 12px; padding: 16px;
  margin-bottom: 12px;
}
.mx-tn-axis { text-align: center; }
.mx-tn-axis .lbl {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mx-dim); font-weight: 700;
  margin-bottom: 4px;
}
.mx-tn-axis .val {
  font-size: 1.2rem; font-weight: 800; color: #fff;
}
.mx-tn-vs {
  font-size: 1.5rem; color: var(--mx-orange);
}
.mx-tn-risk {
  font-size: 0.96rem; line-height: 1.5; color: rgba(255,255,255,0.86);
}
.mx-tn-risk b { color: var(--mx-orange); font-weight: 700; }

/* ===== 12. CTA CURADORIA ===== */
.mat-mx-cta {
  /* herda dos estilos do CTA de enriquecer (.mat-enriquece-card) */
  margin: 24px 0 8px;
  padding: 28px 26px;
  background: linear-gradient(135deg, rgba(255,107,0,0.07), rgba(255,107,0,0.02));
  border: 1px solid rgba(255,107,0,0.28);
  border-radius: 18px;
}

/* ===== MESA DE AGENTES (tela de loading rica) ===== */
.mat-mesa {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex; flex-direction: column;
  height: 100%;
  min-height: 500px;
}
.mat-mesa-head { text-align: center; padding: 24px 0 16px; }
.mat-mesa-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mat-orange, #ff6b00);
  margin-bottom: 10px;
}
.mat-mesa-title {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 800;
  letter-spacing: -0.01em; line-height: 1.2;
  margin-bottom: 14px;
}
.mat-mesa-progress {
  height: 4px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden;
  margin: 0 auto; max-width: 320px;
}
.mat-mesa-progress .bar {
  height: 100%; background: linear-gradient(90deg, #ffc24b, var(--mat-orange, #ff6b00));
  border-radius: 999px;
  transition: width 800ms cubic-bezier(0.22,1,0.36,1);
}
.mat-mesa-room {
  flex: 1;
  overflow-y: auto;
  padding: 16px 4px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 94%, transparent 100%);
}
.mat-mesa-msg {
  display: flex; gap: 12px; align-items: flex-start;
  animation: matMesaIn 350ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes matMesaIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mat-mesa-msg-left  { justify-content: flex-start; }
.mat-mesa-msg-right { justify-content: flex-end; }
.mat-mesa-msg-right .mat-mesa-bubble { order: 1; }
.mat-mesa-msg-right .mat-mesa-avatar { order: 2; }
.mat-mesa-msg-center { justify-content: center; }
.mat-mesa-msg-center .mat-mesa-bubble {
  background: linear-gradient(135deg, rgba(255,107,0,0.12), rgba(255,107,0,0.04));
  border-color: rgba(255,107,0,0.35);
}

.mat-mesa-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid;
  font-size: 0.92rem;
}
.mat-mesa-bubble {
  background: var(--mat-card, #161513);
  border: 1px solid var(--mat-line, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 10px 14px;
  max-width: 78%;
  font-size: 0.93rem; line-height: 1.5;
}
.mat-mesa-meta {
  font-size: 0.72rem; color: var(--mat-dim, rgba(255,255,255,0.62));
  margin-bottom: 4px;
}
.mat-mesa-meta b { color: #fff; }
.mat-mesa-papel { font-weight: 500; }
.mat-mesa-text { color: rgba(255,255,255,0.88); }
.mat-mesa-text b { color: var(--mat-orange, #ff6b00); font-weight: 700; }

/* indicador "digitando…" */
.mat-mesa-typing {
  min-height: 22px;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0; transition: opacity 200ms;
  padding: 4px 0 16px;
}
.mat-mesa-dots i { margin-right: 6px; }
.mat-mesa-dots .d1, .mat-mesa-dots .d2, .mat-mesa-dots .d3 {
  animation: matMesaDot 1.2s infinite;
  display: inline-block;
}
.mat-mesa-dots .d2 { animation-delay: 0.15s; }
.mat-mesa-dots .d3 { animation-delay: 0.3s; }
@keyframes matMesaDot {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

/* ===== DISCLAIMER de IA (rodapé) ===== */
.mat-mosaic-disclaimer {
  grid-column: 1 / -1; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--mx-line);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.72rem; line-height: 1.5; color: var(--mx-faint, rgba(255,255,255,.4));
  max-width: 760px; margin-left: auto; margin-right: auto;
}
.mat-mosaic-disclaimer i { color: var(--mx-orange); margin-top: 2px; flex: none; }

/* ===== REVEAL ao entrar na viewport (aplicado via JS: .mat-reveal → .mat-reveal-in) ===== */
.mat-reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.22,1,.36,1); will-change: opacity, transform; }
.mat-reveal.mat-reveal-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .mat-reveal { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* ===== 7b. DIM CARDS — "Você como líder": grade 2x2 com medidor segmentado animado ===== */
.mat-dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 780px) { .mat-dim-grid { grid-template-columns: 1fr; } }
.mat-dim-card {
  position: relative; padding: 22px 24px 24px; border-radius: 16px;
  border: 1px solid var(--mx-line); background: var(--mx-card); overflow: hidden;
  transition: transform .35s var(--mx-ease), border-color .35s var(--mx-ease);
}
.mat-dim-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--mx-gold, #ffc24b), var(--mx-orange)); opacity: .85; }
.mat-dim-card::after { content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .4s var(--mx-ease); background: radial-gradient(ellipse 70% 90% at 0% 0%, rgba(255,107,0,.10), transparent 60%); }
.mat-dim-card:hover { transform: translateY(-3px); border-color: rgba(255,107,0,.35); }
.mat-dim-card:hover::after { opacity: 1; }
.mat-dim-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.mat-dim-name { font-size: 1.02rem; font-weight: 800; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.mat-dim-score { font-size: 2.1rem; font-weight: 800; line-height: .8; color: var(--mx-orange); white-space: nowrap; }
.mat-dim-score small { font-size: .42em; color: var(--mx-faint, rgba(255,255,255,.34)); font-weight: 600; }
.mat-dim-meter { margin-top: 18px; }
.mat-dim-track { display: flex; gap: 6px; height: 11px; }
.mat-dim-seg { flex: 1; border-radius: 4px; background: rgba(255,255,255,.06); position: relative; overflow: hidden; }
/* fill: cheio por padrão (fallback sem JS); o reveal anima de 0 → valor real */
.mat-dim-fill { position: absolute; inset: 0; border-radius: 4px; transform: scaleX(var(--f, 1)); transform-origin: left;
  background: linear-gradient(90deg, var(--mx-gold, #ffc24b), var(--mx-orange)); transition: transform .55s var(--mx-ease); }
.mat-dim-card.mat-reveal .mat-dim-fill { transform: scaleX(0); }
.mat-dim-card.mat-reveal.mat-reveal-in .mat-dim-fill { transform: scaleX(var(--f, 1)); }
.mat-dim-seg-last .mat-dim-fill { box-shadow: 0 0 12px rgba(255,107,0,.6); }
.mat-dim-seg-last::after { content: ''; position: absolute; right: 3px; top: 50%; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.9); transform: translateY(-50%) scale(1); transition: transform .4s var(--mx-ease) .85s; }
.mat-dim-card.mat-reveal:not(.mat-reveal-in) .mat-dim-seg-last::after { transform: translateY(-50%) scale(0); }

/* ===== 6b. RAIO-X — radar SVG + lista de pilares (medidor segmentado) + stats ===== */
.mat-raiox {
  display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 36px; align-items: center;
  padding: 28px; border: 1px solid var(--mx-line); border-radius: 18px;
  background: linear-gradient(160deg, rgba(255,255,255,.02), transparent 60%);
}
.mat-raiox .mat-radar-wrap { position: relative; display: flex; justify-content: center; align-items: center; }
.mat-radar-pillars { display: flex; flex-direction: column; gap: 4px; }
.mat-rx-row { display: grid; grid-template-columns: 104px 1fr 50px; gap: 14px; align-items: center; padding: 9px 10px; border-radius: 10px; transition: background .25s var(--mx-ease); }
.mat-rx-row:hover, .mat-rx-row.active { background: rgba(255,107,0,.07); }
.mat-rx-name { font-size: 13px; color: var(--mx-dim); transition: color .2s; }
.mat-rx-row:hover .mat-rx-name, .mat-rx-row.active .mat-rx-name { color: #fff; }
.mat-rx-track { display: flex; gap: 5px; height: 10px; }
.mat-rx-seg { flex: 1; border-radius: 3px; background: rgba(255,255,255,.07); position: relative; overflow: hidden; }
.mat-rx-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; width: var(--w, 0); background: linear-gradient(90deg, var(--mx-gold, #ffc24b), var(--mx-orange)); transition: width .6s var(--mx-ease); }
.mat-mx-radar.mat-reveal .mat-rx-fill { width: 0; }
.mat-mx-radar.mat-reveal.mat-reveal-in .mat-rx-fill { width: var(--w, 0); }
.mat-rx-tip .mat-rx-fill { box-shadow: 0 0 10px rgba(255,107,0,.55); }
.mat-rx-val { font-weight: 800; font-size: 1rem; text-align: right; color: var(--mx-orange); white-space: nowrap; }
.mat-rx-val small { font-size: 10px; color: var(--mx-faint, rgba(255,255,255,.34)); font-weight: 600; }
.mat-radar-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--mx-line); font-family: 'SF Mono', Menlo, monospace; font-size: 11.5px; color: var(--mx-faint, rgba(255,255,255,.34)); }
.mat-radar-stats .s { display: flex; align-items: center; gap: 7px; }
.mat-radar-stats b { color: #fff; font-weight: 600; }
.mat-radar-stats .dotmark { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.mat-radar-stats .hi { background: var(--mx-orange); }
.mat-radar-stats .lo { background: rgba(255,255,255,.4); }
.mat-radar-stats .avg { background: var(--mx-gold, #ffc24b); }
@media (max-width: 820px) { .mat-raiox { grid-template-columns: 1fr; gap: 26px; } }

/* ===== CABEÇALHO DE CAPÍTULO (divisões claras do documento) ===== */
.mat-chapter {
  grid-column: 1 / -1;
  max-width: 760px; margin: 8px auto 20px; /* respiro abaixo do cabeçalho (conteúdo não cola) */
  display: flex; align-items: baseline; gap: 18px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.mat-chapter:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.mat-chapter-num {
  flex: none;
  font-size: clamp(1.4rem, 2.2vw, 2.1rem); font-weight: 800; line-height: 1;
  color: var(--mx-orange); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.mat-chapter-txt { flex: 1 1 auto; }
.mat-chapter-h {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff 0%, #ffd9b0 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.mat-chapter-obj {
  margin: 6px 0 0; max-width: 56ch;
  font-size: 0.92rem; line-height: 1.4; font-weight: 400;
  color: var(--mx-dim);
}

/* ===== ÍNDICE FLUTUANTE (à direita) — chips com nome do capítulo, sempre visíveis ===== */
.mat-toc {
  position: fixed;
  right: clamp(12px, 1.6vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 90; /* acima do #matApp (fixed, z-index 80, bg opaco) senão fica tampado */
  pointer-events: auto;
  display: none; /* sem espaço ao lado do doc em telas estreitas */
}
@media (min-width: 1180px) {
  .mat-toc { display: block; }
}
.mat-toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mat-toc-item {
  display: inline-flex; align-items: center; gap: 7px; flex-direction: row-reverse;
  cursor: pointer;
  max-width: 220px;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(18,18,24,0.72);
  border: 1px solid rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.62);
  transition: color 160ms var(--mx-ease, ease), background 160ms ease, border-color 160ms ease;
}
.mat-toc-dot {
  flex: none; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: 0.7;
  transition: background 160ms ease, box-shadow 160ms ease;
}
.mat-toc-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mat-toc-item:hover { color: #fff; border-color: rgba(255,255,255,0.2); background: rgba(28,28,36,0.85); }
.mat-toc-item.active {
  color: #fff;
  border-color: rgba(255,107,0,0.55);
  background: rgba(255,107,0,0.16);
}
.mat-toc-item.active .mat-toc-dot {
  background: var(--mat-orange, #ff6b00); opacity: 1;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.2);
}

/* unknown fallback */
.mat-mx-unknown {
  padding: 12px; border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 8px; color: var(--mx-dim); font-size: 0.84rem;
}
.mat-mx-unknown code {
  background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono', Menlo, monospace;
}
