/* Mapa mental interativo (usado na área do aluno e na demonstração da página de vendas) */
.mv {
  --level: var(--primary);
  position: relative;
  width: 100%; height: 100%;
  min-height: 320px;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--level) 10%, transparent), transparent 60%),
    radial-gradient(circle, color-mix(in srgb, var(--ink) 9%, transparent) 1.2px, transparent 1.3px) 0 0 / 22px 22px,
    var(--surface);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mv-static { touch-action: auto; }

.mv-viewport { position: absolute; inset: 0; cursor: grab; }
.mv-static .mv-viewport { cursor: default; }
.mv.dragging .mv-viewport { cursor: grabbing; }
.mv-stage { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }

.mv-links { position: absolute; left: 0; top: 0; max-width: none; overflow: visible; pointer-events: none; }
.mv-line { fill: none; stroke: var(--c); stroke-width: 4; stroke-linecap: round; opacity: .55; transition: opacity .3s, stroke-width .3s; }
.mv-flow { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 14; opacity: 0; transition: opacity .4s; }
.mv-ready .mv-flow { opacity: .9; animation: mv-flow 1.2s linear infinite; }
@keyframes mv-flow { to { stroke-dashoffset: -32; } }
.mv-sat line { stroke: var(--c); stroke-width: 2; opacity: .35; }
.mv-sat circle { fill: var(--c); opacity: .5; transform-box: fill-box; transform-origin: center; }
.mv-ready .mv-sat circle { animation: mv-bob 3s ease-in-out infinite; animation-delay: calc(var(--k) * -.8s); }
@keyframes mv-bob { 50% { transform: scale(1.35); opacity: .8; } }

.mv.has-active .mv-link:not(.active) { opacity: .25; }
.mv-link { transition: opacity .35s; }
.mv-link.active .mv-line { opacity: 1; stroke-width: 6; }

.mv-node {
  position: absolute; left: 0; top: 0;
  width: max-content;
  transform: translate(-50%, -50%);
  border: 0; cursor: pointer;
  font-family: var(--font-display);
  -webkit-tap-highlight-color: transparent;
  transition: transform .35s var(--spring), box-shadow .3s, opacity .3s, filter .3s;
}
.mv-static .mv-node { cursor: default; }

.mv-center {
  display: grid; justify-items: center; gap: 2px;
  min-width: 200px; max-width: 260px;
  padding: 18px 24px 16px;
  border-radius: 26px;
  background: var(--level); color: #fff;
  text-align: center;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--level) 70%, black), 0 20px 50px color-mix(in srgb, var(--level) 40%, transparent);
  z-index: 3;
}
.mv-center::before {
  content: ''; position: absolute; inset: -10px; border-radius: 34px;
  border: 2px dashed color-mix(in srgb, var(--level) 45%, transparent);
  animation: mv-spin 18s linear infinite;
}
@keyframes mv-spin { to { transform: rotate(360deg); } }
.mv-center .mv-ico { font-size: 34px; line-height: 1; margin-bottom: 4px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.mv-center strong { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.mv-center small { font-family: var(--font-body); font-size: 13.5px; font-weight: 700; opacity: .85; }

.mv-branch {
  display: inline-flex; align-items: center; gap: 10px;
  max-width: 210px;
  padding: 11px 16px 11px 11px;
  border-radius: 18px;
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 2.5px var(--c), 0 5px 0 color-mix(in srgb, var(--c) 55%, white), 0 12px 24px rgba(27,26,46,.08);
  font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; text-align: left;
  z-index: 2;
}
.mv-num {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--c); color: #fff; font-size: 15px;
}
.mv:not(.mv-static) .mv-branch:hover { transform: translate(-50%, -50%) scale(1.06); }
.mv-branch.active {
  background: var(--c); color: #fff;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 65%, black), 0 18px 40px color-mix(in srgb, var(--c) 45%, transparent);
  z-index: 4;
}
.mv-branch.active .mv-num { background: #fff; color: var(--c); }
.mv.has-active .mv-branch:not(.active) { opacity: .55; filter: saturate(.6); }
.mv-center.active { transform: translate(-50%, -50%) scale(1.05); }

/* Controles */
.mv-controls {
  position: absolute; right: 14px; bottom: 14px; z-index: 5;
  display: flex; flex-direction: column; gap: 8px;
  transition: opacity .3s, transform .3s var(--ease);
}
.mv-controls .icon-btn { width: 42px; height: 42px; box-shadow: inset 0 0 0 2px var(--line), var(--shadow-sm); }

.mv-hint {
  position: absolute; left: 50%; bottom: 16px; z-index: 4;
  transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700;
  pointer-events: none; white-space: nowrap;
  animation: mv-hint 2.4s var(--ease) infinite;
  transition: opacity .3s;
}
.mv-hint.gone { opacity: 0; }
@keyframes mv-hint { 50% { transform: translateX(-50%) translateY(-5px); } }

/* Painel */
.mv-panel {
  --c: var(--primary);
  position: absolute; z-index: 10;
  top: 14px; right: 14px; bottom: 14px;
  width: min(400px, calc(100% - 28px));
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 30%, var(--line)), var(--shadow-lg);
  transform: translateX(calc(100% + 30px));
  transition: transform .45s var(--spring);
  overflow: hidden;
}
.mv-panel.open { transform: none; }
.mv-panel[hidden] { display: none; }
.mv.panel-open .mv-controls { transform: translateX(-420px); }

.mv-ph {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 14px;
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border-bottom: 2px solid color-mix(in srgb, var(--c) 20%, transparent);
}
.mv-ph h3 { flex: 1; font-size: 22px; font-weight: 800; }
.mv-pnum {
  display: flex; align-items: baseline; justify-content: center; flex: none;
  line-height: 46px;
  min-width: 46px; height: 46px; padding: 0 8px; border-radius: 14px;
  background: var(--c); color: #fff;
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
}
.mv-pnum small { font-size: 12px; opacity: .8; margin-left: 1px; }
.mv-pnum svg { width: 24px; height: 24px; align-self: center; }
.mv-close { width: 40px; height: 40px; flex: none; }

.mv-pbody { flex: 1; overflow-y: auto; padding: 18px 16px 8px; overscroll-behavior: contain; }
.mv-rule {
  padding: 14px 16px; border-radius: 16px;
  background: var(--bg); border: 2px dashed color-mix(in srgb, var(--c) 40%, transparent);
  font-weight: 700; font-size: 16px; color: var(--ink);
}
.mv-ex { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.mv-ex li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: 16px;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--line);
  animation: mv-in .5s var(--spring) backwards; animation-delay: calc(var(--k) * 90ms + 120ms);
  transition: box-shadow .2s;
}
.mv-ex li.speaking { box-shadow: inset 0 0 0 2.5px var(--c); }
@keyframes mv-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.mv-say {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 13px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--c) 14%, white); color: var(--c);
  transition: transform .2s var(--spring), background .2s;
}
.mv-say:hover { transform: scale(1.08); background: color-mix(in srgb, var(--c) 22%, white); }
.mv-say:active { transform: scale(.92); }
.mv-say svg { width: 22px; height: 22px; }
.speaking .mv-say { background: var(--c); color: #fff; animation: mv-pulse 1s ease-in-out infinite; }
@keyframes mv-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 18%, transparent); } }
.mv-en { font-size: 18px; font-weight: 800; line-height: 1.3; color: var(--ink); cursor: pointer; user-select: text; -webkit-user-select: text; }
.mv-pt { margin-top: 3px; font-size: 15px; color: var(--muted); font-weight: 600; transition: filter .3s, color .3s; user-select: text; -webkit-user-select: text; }
.mv-hide-pt .mv-pt:not(.shown) { filter: blur(6px); cursor: pointer; }
.mv-hide-pt .mv-pt:not(.shown)::after { content: ''; }

.mv-tip {
  padding: 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--sun) 22%, white);
  font-weight: 600; font-size: 16px;
}
.mv-outline { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.mv-outline button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--line);
  font-weight: 800; text-align: left;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.mv-outline button:hover { transform: translateX(4px); box-shadow: inset 0 0 0 2px var(--c); }
.mv-outline span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--c); color: #fff; font-size: 14px; }

.mv-pnav { display: flex; gap: 10px; padding: 12px 16px 16px; border-top: 2px solid var(--line); }
.mv-pnav .btn { flex: 1; }
.mv-pnav .btn svg { width: 18px; height: 18px; }

/* Legenda da demonstração automática */
.mv-caption {
  --c: var(--primary);
  position: absolute; left: 50%; bottom: 14px; z-index: 6;
  width: min(360px, calc(100% - 28px));
  display: grid; gap: 2px;
  padding: 12px 16px; border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--c), var(--shadow);
  transform: translate(-50%, 20px); opacity: 0;
  pointer-events: none;
}
.mv-caption.show { animation: mv-cap 2.6s var(--ease) forwards; }
@keyframes mv-cap {
  0% { transform: translate(-50%, 20px); opacity: 0; }
  12%, 85% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -6px); opacity: 0; }
}
.mv-caption strong { font-family: var(--font-display); color: var(--c); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.mv-caption span { font-weight: 800; font-size: 17px; }
.mv-caption em { font-style: normal; color: var(--muted); font-size: 14px; font-weight: 600; }

/* Celular: painel vira gaveta de baixo */
.mv[data-layout='tree'] .mv-center { min-width: 180px; padding: 14px 18px 12px; }
.mv[data-layout='tree'] .mv-center strong { font-size: 19px; }
.mv[data-layout='tree'] .mv-branch { max-width: 190px; font-size: 15px; }

@media (max-width: 719px) {
  .mv-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-height: 78%;
    border-radius: 24px 24px 0 0;
    transform: translateY(calc(100% + 20px));
  }
  .mv-panel::before {
    content: ''; position: absolute; top: 7px; left: 50%; width: 44px; height: 5px;
    margin-left: -22px; border-radius: 9px; background: rgba(27,26,46,.18);
  }
  .mv-ph { padding-top: 20px; }
  .mv.panel-open .mv-controls { transform: none; opacity: 0; pointer-events: none; }
  .mv-ph h3 { font-size: 20px; }
  .mv-en { font-size: 17px; }
}
