/* M139 — grafo neural da home: moldura, legenda, controles e pílula de informação. */
.m93-lower .graph-wrap,
.graph-wrap#grafo {
  min-height: 560px;
  height: 560px;
  border: 1px solid rgba(255, 204, 98, .38);
  border-radius: 18px;
  background: #040d20;
  box-shadow: 0 0 0 1px rgba(2, 8, 20, .8), 0 18px 48px rgba(0, 0, 0, .45), inset 0 0 60px rgba(255, 190, 90, .05);
  overflow: hidden;
}
.graph-wrap:before { display: none; }
.graph-wrap canvas#graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
  touch-action: none;
}
.graph-wrap canvas#graph:focus { outline: none; }
.graph-wrap canvas#graph:focus-visible {
  outline: 2px solid #ffcc62;
  outline-offset: -4px;
  border-radius: 16px;
}

/* Legenda */
.graph-wrap .legend {
  right: 20px;
  top: 18px;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #eef4ff;
  background: rgba(3, 12, 28, .55);
  border: 1px solid rgba(255, 204, 98, .18);
  border-radius: 12px;
  backdrop-filter: blur(3px);
  text-shadow: 0 1px 4px #000;
}
.graph-wrap .legend span { gap: 9px; }
.graph-wrap .legend i {
  width: 11px;
  height: 11px;
  box-shadow: 0 0 8px currentColor;
}
.graph-wrap .legend i.blue { background: #4f78ff; color: #4f78ff; }
.graph-wrap .legend i.cyan { background: #35d4e6; color: #35d4e6; }
.graph-wrap .legend i.gold { background: #ffcc62; color: #ffcc62; }
.graph-wrap .legend i.orange { background: #ff9a3c; color: #ff9a3c; }
.graph-wrap .legend i.violet { background: #a974ff; color: #a974ff; }

/* Botões + − ⤢ */
.graph-wrap .graph-actions {
  right: 20px;
  bottom: 20px;
  top: auto;
  z-index: 2;
  gap: 0;
  border: 1px solid rgba(255, 204, 98, .55);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(3, 10, 24, .88);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.graph-wrap .graph-actions button {
  width: 44px;
  height: 44px;
  border: 0;
  border-bottom: 1px solid rgba(255, 204, 98, .28);
  background: transparent;
  color: #ffe2a3;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.graph-wrap .graph-actions button:last-child { border-bottom: 0; }
.graph-wrap .graph-actions button:hover { background: rgba(255, 204, 98, .16); color: #fff; }
.graph-wrap .graph-actions button:focus-visible {
  outline: 2px solid #ffcc62;
  outline-offset: -3px;
}

/* Pílula de informação */
.graph-wrap .node-info {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 18px;
  max-width: calc(100% - 100px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  font-size: 13px;
  line-height: 1.35;
  color: #f1ecdf;
  background: rgba(3, 12, 28, .82);
  border: 1px solid rgba(255, 204, 98, .5);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.graph-wrap .node-info::before {
  content: "";
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffcc62' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M12 6.5C10 5 7 4.6 3 5v13c4-.4 7 0 9 1.5 2-1.500 5-1.900 9-1.500V5c-4-.4-7 0-9 1.500z'/%3E%3Cpath d='M12 6.500v13'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 900px) {
  .m93-lower .graph-wrap, .graph-wrap#grafo { min-height: 480px; height: 480px; }
}
@media (max-width: 560px) {
  .m93-lower .graph-wrap, .graph-wrap#grafo { min-height: 420px; height: 420px; border-radius: 14px; }
  .graph-wrap .graph-actions { right: 10px; bottom: 10px; top: auto; }
  .graph-wrap .graph-actions button { width: 38px; height: 38px; }
  .graph-wrap .node-info { left: 10px; bottom: 10px; max-width: calc(100% - 70px); font-size: 11px; padding: 7px 12px 7px 9px; border-radius: 14px; }
  .graph-wrap .node-info::before { flex-basis: 18px; width: 18px; height: 18px; }
}
